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

Improve Redirect to HTTPs behaviour #619

Merged
merged 1 commit into from
Jul 3, 2020
Merged

Conversation

JoelSpeed
Copy link
Member

@JoelSpeed JoelSpeed commented Jun 14, 2020

Description

Moves the logic for redirecting to HTTPs to a middleware package and adds tests for this logic.
Also makes the functionality more useful, previously it always redirected to the HTTPS address of the proxy, which may not have been intended, now it will redirect based on if a port is provided in the URL (assume public facing 80 to 443 or 4180 to 8443 for example)

Motivation and Context

Trying to break logic down into smaller logic chunks. First in a step to migrating a few areas of the code to small middlewares.

How Has This Been Tested?

Unit testing.

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

@JoelSpeed JoelSpeed force-pushed the https-redirect-middleware branch 2 times, most recently from a599389 to c3843fc Compare June 19, 2020 17:22
@JoelSpeed JoelSpeed force-pushed the https-redirect-middleware branch 2 times, most recently from f06e065 to 498975c Compare July 1, 2020 20:22
@JoelSpeed
Copy link
Member Author

@jmickey Not sure if you're still interested in this project or not, but since you originally authored the redirect to https behaviour, might be good to get your opinion on this change

@jmickey
Copy link
Contributor

jmickey commented Jul 2, 2020

👋 I would be happy to take a look! I should be able to do that later this arvo.

jmickey
jmickey previously approved these changes Jul 3, 2020
@jmickey
Copy link
Contributor

jmickey commented Jul 3, 2020

LGTM. Solid solution and good tests. Agree that it's also more useful!

Moves the logic for redirecting to HTTPs to a middleware package and adds tests for this logic.
Also makes the functionality more useful, previously it always redirected to the HTTPS address of the proxy, which may not have been intended, now it will redirect based on if a port is provided in the URL (assume public facing 80 to 443 or 4180 to 8443 for example)
@JoelSpeed JoelSpeed force-pushed the https-redirect-middleware branch from 498975c to 1c11067 Compare July 3, 2020 16:20
@JoelSpeed JoelSpeed requested a review from a team as a code owner July 3, 2020 16:20
@JoelSpeed
Copy link
Member Author

Rebased to fix changelog conflict, no other changes, going to merge based on @jmickey's review

Thanks @jmickey 😄

@JoelSpeed JoelSpeed merged commit c4cf15f into master Jul 3, 2020
@JoelSpeed JoelSpeed deleted the https-redirect-middleware branch July 3, 2020 16:25
Jing-ze pushed a commit to Jing-ze/oauth2-proxy that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants