Merge pull request #2192 from jawys/fix-use-x-forwarded-uri-for-pathregex-match
fix: use X-Forwarded-Uri if it exists for pathRegex match
This commit is contained in:
		
						commit
						d9b9bcf9d4
					
				|  | @ -7,6 +7,7 @@ | ||||||
| ## Breaking Changes | ## Breaking Changes | ||||||
| 
 | 
 | ||||||
| ## Changes since v7.4.0 | ## Changes since v7.4.0 | ||||||
|  | - [#2133](https://github.com/oauth2-proxy/oauth2-proxy/pull/2133) Use X-Forwarded-Uri if it exists for pathRegex match | ||||||
| - [#2028](https://github.com/oauth2-proxy/oauth2-proxy/pull/2028) Update golang.org/x/net to v0.7.0 ato address GHSA-vvpx-j8f3-3w6h | - [#2028](https://github.com/oauth2-proxy/oauth2-proxy/pull/2028) Update golang.org/x/net to v0.7.0 ato address GHSA-vvpx-j8f3-3w6h | ||||||
| - [#1873](https://github.com/oauth2-proxy/oauth2-proxy/pull/1873) Fix empty users with some OIDC providers (@babs) | - [#1873](https://github.com/oauth2-proxy/oauth2-proxy/pull/1873) Fix empty users with some OIDC providers (@babs) | ||||||
| - [#1882](https://github.com/oauth2-proxy/oauth2-proxy/pull/1882) Make `htpasswd.GetUsers` racecondition safe | - [#1882](https://github.com/oauth2-proxy/oauth2-proxy/pull/1882) Make `htpasswd.GetUsers` racecondition safe | ||||||
|  |  | ||||||
|  | @ -554,7 +554,7 @@ func isAllowedMethod(req *http.Request, route allowedRoute) bool { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func isAllowedPath(req *http.Request, route allowedRoute) bool { | func isAllowedPath(req *http.Request, route allowedRoute) bool { | ||||||
| 	matches := route.pathRegex.MatchString(req.URL.Path) | 	matches := route.pathRegex.MatchString(requestutil.GetRequestURI(req)) | ||||||
| 
 | 
 | ||||||
| 	if route.negate { | 	if route.negate { | ||||||
| 		return !matches | 		return !matches | ||||||
|  | @ -575,7 +575,7 @@ func (p *OAuthProxy) isAllowedRoute(req *http.Request) bool { | ||||||
| 
 | 
 | ||||||
| func (p *OAuthProxy) isAPIPath(req *http.Request) bool { | func (p *OAuthProxy) isAPIPath(req *http.Request) bool { | ||||||
| 	for _, route := range p.apiRoutes { | 	for _, route := range p.apiRoutes { | ||||||
| 		if route.pathRegex.MatchString(req.URL.Path) { | 		if route.pathRegex.MatchString(requestutil.GetRequestURI(req)) { | ||||||
| 			return true | 			return true | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue