File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
main/java/org/springframework/web/server/adapter
test/java/org/springframework/web/server/adapter Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -90,19 +90,19 @@ public void xForwardedPrefix() throws Exception {
90
90
assertForwardedHeadersRemoved (request );
91
91
}
92
92
93
- @ Test
94
- public void emptyXForwardedPrefixShouldNotLeadToDecodedPath () throws Exception {
93
+ @ Test // gh-23305
94
+ public void xForwardedPrefixShouldNotLeadToDecodedPath () throws Exception {
95
95
HttpHeaders headers = new HttpHeaders ();
96
- headers .add ("X-Forwarded-Prefix" , "" );
96
+ headers .add ("X-Forwarded-Prefix" , "/prefix " );
97
97
ServerHttpRequest request = MockServerHttpRequest
98
98
.method (HttpMethod .GET , new URI ("https://example.com/a%20b?q=a%2Bb" ))
99
99
.headers (headers )
100
100
.build ();
101
101
102
102
request = this .requestMutator .apply (request );
103
103
104
- assertThat ( request . getURI ()). isEqualTo ( new URI ("https://example.com/a%20b?q=a%2Bb" ));
105
- assertThat ( request .getPath ().value ()). isEqualTo ( "/a%20b" );
104
+ assertEquals ( new URI ("https://example.com/prefix/ a%20b?q=a%2Bb" ), request . getURI ( ));
105
+ assertEquals ( "/prefix/a%20b" , request .getPath ().value ());
106
106
assertForwardedHeadersRemoved (request );
107
107
}
108
108
You can’t perform that action at this time.
0 commit comments