You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-11-06 08:59:21 +02:00
Fix upstream proxy appending ? to requests
This commit is contained in:
@@ -153,6 +153,7 @@ func setProxyDirector(proxy *httputil.ReverseProxy) {
|
||||
// use RequestURI so that we aren't unescaping encoded slashes in the request path
|
||||
req.URL.Opaque = req.RequestURI
|
||||
req.URL.RawQuery = ""
|
||||
req.URL.ForceQuery = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,29 @@ var _ = Describe("HTTP Upstream Suite", func() {
|
||||
},
|
||||
expectedUpstream: "encodedSlashes",
|
||||
}),
|
||||
Entry("request a path with an empty query string", &httpUpstreamTableInput{
|
||||
id: "default",
|
||||
serverAddr: &serverAddr,
|
||||
target: "http://example.localhost/foo?",
|
||||
method: "GET",
|
||||
body: []byte{},
|
||||
errorHandler: nil,
|
||||
expectedResponse: testHTTPResponse{
|
||||
code: 200,
|
||||
header: map[string][]string{
|
||||
contentType: {applicationJSON},
|
||||
},
|
||||
request: testHTTPRequest{
|
||||
Method: "GET",
|
||||
URL: "http://example.localhost/foo?",
|
||||
Header: map[string][]string{},
|
||||
Body: []byte{},
|
||||
Host: "example.localhost",
|
||||
RequestURI: "http://example.localhost/foo?",
|
||||
},
|
||||
},
|
||||
expectedUpstream: "default",
|
||||
}),
|
||||
Entry("when the request has a body", &httpUpstreamTableInput{
|
||||
id: "requestWithBody",
|
||||
serverAddr: &serverAddr,
|
||||
|
||||
Reference in New Issue
Block a user