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

calculated forwarded prefix using path and original uri #377

Closed
wants to merge 2 commits into from

Conversation

ryandawsonuk
Copy link
Contributor

for #314

@spencergibb
Copy link
Member

I've never heard of x original uri, can you point me to some resources?

@codecov-io
Copy link

codecov-io commented Jun 20, 2018

Codecov Report

Merging #377 into master will increase coverage by 3.07%.
The diff coverage is 81.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #377      +/-   ##
==========================================
+ Coverage   65.36%   68.44%   +3.07%     
==========================================
  Files           4      124     +120     
  Lines         231     3473    +3242     
  Branches       17      237     +220     
==========================================
+ Hits          151     2377    +2226     
- Misses         68      966     +898     
- Partials       12      130     +118
Impacted Files Coverage Δ
...ateway/filter/headers/XForwardedHeadersFilter.java 84.84% <81.25%> (ø)
...work/cloud/gateway/support/ConfigurationUtils.java 56.25% <0%> (ø)
...cloud/gateway/filter/LoadBalancerClientFilter.java 91.66% <0%> (ø)
...d/gateway/route/CachingRouteDefinitionLocator.java 81.81% <0%> (ø)
.../handler/predicate/QueryRoutePredicateFactory.java 68.42% <0%> (ø)
...framework/cloud/gateway/event/FilterArgsEvent.java 100% <0%> (ø)
...oud/gateway/actuate/GatewayControllerEndpoint.java 42.85% <0%> (ø)
...ilter/factory/StripPrefixGatewayFilterFactory.java 94.44% <0%> (ø)
.../cloud/gateway/support/ServerWebExchangeUtils.java 89.18% <0%> (ø)
...oud/gateway/filter/WebClientHttpRoutingFilter.java 0% <0%> (ø)
... and 111 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2816605...0f3efb1. Read the comment docs.

@ryandawsonuk
Copy link
Contributor Author

Seems from a bit of searching to be an nginx thing, which makes sense as I'm running behind an Ingress. I guess this means this solution is not generic and I should close the PR.

@ryandawsonuk
Copy link
Contributor Author

@spencergibb Would RouteToRequestUrlFilter be a better place to check for and add the prefix header (if an appropriate property is set)?

@spencergibb
Copy link
Member

I don't think so.

@ryandawsonuk
Copy link
Contributor Author

Or maybe it can be done in XForwardedHeadersFilter by getting the Route object from exchange.getAttribute(GATEWAY_ROUTE_ATTR)

@spencergibb
Copy link
Member

That seems like a better way.

Johnny850807 pushed a commit to Johnny850807/spring-cloud-gateway that referenced this pull request Dec 14, 2020
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