Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Issue 391 fix http 302 redirects behind proxy #393

Merged
merged 1 commit into from Jan 29, 2019
Merged

Issue 391 fix http 302 redirects behind proxy #393

merged 1 commit into from Jan 29, 2019

Conversation

ggalmazor
Copy link
Contributor

Closes #391

Build on top of #390. See just the last commit

What has been done to verify that this works as intended?

To check that this works, you have to verify that logging in and changing the administrator password works as expected.

I've verified it in the local dev server (gradle), with the local cloudconfig stack.

I'm testing it on DO as well. Will update this when I get the results.

Why is this the best possible solution? Were any other approaches considered?

This bug is related to how Swing builds redirection URLs with the HttpServletResponse.sendRedirect() method.

When Aggregate is running behind a proxy, the URLs Swing generates have the wrong domain, wrong port, or they can lack the port number, which won't work.

After searching for uses of sendRedirect() in the code, I've seen a few of them that could be replaced by manually setting the redirection response:

  • set the status to 302

  • set a Location header with an absolute path, but without setting the domain&port

    This works around the issue, and it doesn't affect to normal Aggregate setups without proxies.

Are there any risks to merging this code? If so, what are they?

Nope.

Do we need any specific form for testing your changes? If so, please attach one

Nope.

Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.

No.

@ggalmazor ggalmazor added this to Needs review in v2.0.0 via automation Jan 29, 2019
@ggalmazor ggalmazor added this to the v2.0.0 milestone Jan 29, 2019
@ggalmazor ggalmazor mentioned this pull request Jan 29, 2019
v2.0.0 automation moved this from Needs review to Reviewer approved Jan 29, 2019
- When Aggregate is running behind a proxy, Swing will generate wrong Location URLs (wrong domain, wrong port number, or even removing the port number)
- Also, make the multimode and the change password redirect urls static and absolute to leave no space for Swing messing up stuff (the tradeoff is coupling the multimode login servlet to the actual location of the redirected pages, which is not desirable under normal circumstances)
@ggalmazor ggalmazor merged commit fd13004 into getodk:master Jan 29, 2019
v2.0.0 automation moved this from Reviewer approved to Done Jan 29, 2019
@ggalmazor ggalmazor deleted the issue_391_fix_http_302_redirects_behind_proxy branch January 29, 2019 16:51
yanokwa pushed a commit to yanokwa/odk-aggregate that referenced this pull request Jan 29, 2019
- When Aggregate is running behind a proxy, Swing will generate wrong Location URLs (wrong domain, wrong port number, or even removing the port number)
- Also, make the multimode and the change password redirect urls static and absolute to leave no space for Swing messing up stuff (the tradeoff is coupling the multimode login servlet to the actual location of the redirected pages, which is not desirable under normal circumstances)
yanokwa pushed a commit to yanokwa/odk-aggregate that referenced this pull request Jan 31, 2019
- When Aggregate is running behind a proxy, Swing will generate wrong Location URLs (wrong domain, wrong port number, or even removing the port number)
- Also, make the multimode and the change password redirect urls static and absolute to leave no space for Swing messing up stuff (the tradeoff is coupling the multimode login servlet to the actual location of the redirected pages, which is not desirable under normal circumstances)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v2.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants