Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForwardedHeaderFilter garbles query params during sendRedirect() [SPR-16506] #21049

Closed
spring-projects-issues opened this issue Feb 15, 2018 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Timothy Aitken opened SPR-16506 and commented

The ForwardedHeaderFilter garbles the query-string provided to sendRedirect(). If both the original request and the provided location both contain a query, then the two are improperly concatenated (with a extra "?" between them) making the resulting location redirect invalid, eg:

http://hostname:port/path?newqp=1?oldqp=2

The expected behavior should be one of:

  1. fail-out explicitly, rather than returning garbage
  2. properly concatenate the two lists of params
  3. replace the old params with the new ones if provided

I'm not sure which of these are preferable, but #3 seems most consistent with the behavior when this filter is removed.


Affects: 4.3.10

Referenced from: commits 6920a1f, 608ef46, ac495d7

Backported to: 4.3.15

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

#3 it is. This was a bug, never the intent to propagate the query from the current request at this level. RedirectView does have a property that an application can use to opt into #2.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants