File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ func TestServeHTTP_GraphQLIntrospectionPassthrough(t *testing.T) {
188188 assert .Contains (t , w .Body .String (), "__schema" )
189189}
190190
191- func TestServeHTTP_GraphQLQueryStringForwardedToUpstream (t * testing.T ) {
191+ func TestServeHTTP_GraphQLPreservesQueryString (t * testing.T ) {
192192 var receivedURL string
193193 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
194194 receivedURL = r .URL .RequestURI ()
@@ -202,9 +202,10 @@ func TestServeHTTP_GraphQLQueryStringForwardedToUpstream(t *testing.T) {
202202 s := newTestServer (t , upstream .URL )
203203 h := & proxyHandler {server : s }
204204
205- gqlBody , _ := json .Marshal (map [string ]interface {}{
205+ gqlBody , err := json .Marshal (map [string ]interface {}{
206206 "query" : `{ repository(owner:"org", name:"repo") { issues(first: 10) { nodes { id } } } }` ,
207207 })
208+ require .NoError (t , err )
208209 req := httptest .NewRequest (http .MethodPost , "/graphql?foo=bar" , bytes .NewReader (gqlBody ))
209210 req .Header .Set ("Content-Type" , "application/json" )
210211 w := httptest .NewRecorder ()
You can’t perform that action at this time.
0 commit comments