-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds more standard compliant request body handling (#2260)
- Loading branch information
Daniel A. White
authored
Apr 12, 2023
1 parent
00233b7
commit 3b56cb7
Showing
5 changed files
with
67 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
====test==== | ||
Making a GET request with a Content-Type header through the proxy server ignores null body | ||
====spec==== | ||
swagger: "2.0" | ||
paths: | ||
/status/204: | ||
get: | ||
produces: | ||
- text/plain | ||
responses: | ||
204: | ||
description: No Content | ||
====server==== | ||
proxy -p 4010 ${document} http://httpbin.org | ||
====command==== | ||
curl -i http://localhost:4010/status/204 -X GET --header 'Content-Type: application/json' | ||
====expect==== | ||
HTTP/1.1 204 No Content |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
====test==== | ||
Making a GET request with request body through the proxy server rejects with 501 | ||
====spec==== | ||
swagger: "2.0" | ||
paths: | ||
/status/204: | ||
get: | ||
produces: | ||
- text/plain | ||
responses: | ||
204: | ||
description: No Content | ||
====server==== | ||
proxy -p 4010 ${document} http://httpbin.org | ||
====command==== | ||
curl -i http://localhost:4010/status/204 -X GET --header 'Content-Type: application/json' --data '{}' | ||
====expect==== | ||
HTTP/1.1 501 Not Implemented | ||
|
||
{"type":"https://stoplight.io/prism/errors#PROXY_UNSUPPORTED_REQUEST_BODY","title":"The Prism proxy does not support sending a GET/HEAD request with a message body to an upstream server. See: https://github.com/stoplightio/prism/issues/2259","status":501,"detail":""} |