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

THREESCALE-8426 - request path is stripped for proxied https requests #1342

Merged
merged 4 commits into from
Jun 10, 2022

Conversation

samugi
Copy link
Contributor

@samugi samugi commented May 16, 2022

This is a fix for THREESCALE-8426 where in some situations the client's request path is stripped away from the proxied upstream request.

Steps to reproduce the issue:

Problem

The problem is that we set the upstream request's path using uri.path (when available) here.

uri.path, is upstream.uri.path, where upstream.uri is self.uri i.e. only the prefix (aka the upstream path that is hardcoded in the Private URL when the Backend is defined), which explains the problem as described above.

Fix

Currently we rewrite ngx.var.uri to contain the exact path for the upstream request here by appending the value of ngx.var.uri to the Backend prefix.
This means we should use ngx.var.uri as the path for the proxied request here, instead of uri.path.

@samugi samugi requested a review from a team as a code owner May 16, 2022 17:00
@samugi samugi force-pushed the THREESCALE-8426 branch 3 times, most recently from 20e21ff to ab4ab2b Compare May 16, 2022 17:13
@samugi samugi requested review from a team and removed request for a team May 16, 2022 17:14
@samugi samugi force-pushed the THREESCALE-8426 branch 2 times, most recently from 29ce87b to f25fb9d Compare May 17, 2022 09:19
@samugi samugi changed the title [WIP] - THREESCALE-8426 THREESCALE-8426 - request path is stripped for proxied https requests May 17, 2022
@kevprice83 kevprice83 requested a review from a team May 26, 2022 14:28
@samugi samugi requested a review from kevprice83 June 3, 2022 07:43
Copy link
Member

@kevprice83 kevprice83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, added a new test to cover the additional issue found (same problem occurs when routing policy is enabled)

@kevprice83 kevprice83 merged commit 02f3c0d into master Jun 10, 2022
@kevprice83 kevprice83 deleted the THREESCALE-8426 branch June 10, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants