-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(proxy/pdk) re-implement X-Forwarded-Prefix / kong.request.get_for…
…warded_prefix ### Summary The PR #5620 implemented `X-Forwarded-Prefix` wrong as reported in these: - #6190 - Kong/kubernetes-ingress-controller#784 - #6132 And also by some other sources. This commit re-implements `X-Forwarded-Prefix`: 1. Is there trusted `X-Forwarded-Prefix` header in request? If yes, then set that as the `X-Forwarded-Prefix` (note: at this point we don't support multi-value `X-Forwarded-Prefix` headers, e.g. appending. We don't support multi-value in `X-Forwarded-Host/-Port/-Proto` either. 2. Has Kong router stripped the prefix of the request URI before proxying, if yes, then set `X-Forwarded-Prefix` to match the stripped prefix. 3. If 1 or 2 didn't set the header, set it to `/`. ### Issues Resolved Fix #6190 Fix Kong/kubernetes-ingress-controller#784 Fix #6132
- Loading branch information
Showing
7 changed files
with
313 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.