-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* http_server: do not try to unmarshal empty body for bounce-json * control can be used for response headers * finished implementing control structures for response headers; completed apitest; see #65689 * fixed control for header top level key; small fixes after change request Co-authored-by: Philipp Hempel <philipp.hempel@programmfabrik.de>
- Loading branch information
Showing
12 changed files
with
180 additions
and
54 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,82 @@ | ||
{ | ||
"http_server": { | ||
"addr": ":9999", | ||
"dir": "../_res/assets/", | ||
"testmode": false | ||
}, | ||
"name": "check control structures in header", | ||
"tests": [ | ||
{ | ||
"name": "check HTTP header and bounced header using control", | ||
"request": { | ||
"server_url": "http://localhost:9999", | ||
"endpoint": "bounce-json", | ||
"method": "POST", | ||
"header": { | ||
"header1": "ABC", | ||
"header2": "123" | ||
} | ||
}, | ||
"response": { | ||
// check actual HTTP headers | ||
"header": { | ||
"Content-Type:control": { | ||
"element_count": 1 | ||
}, | ||
"xxx:control": { | ||
"must_not_exist": true | ||
} | ||
}, | ||
"body": { | ||
// check bounced headers as part of the response body | ||
"header": { | ||
"Header1": [ | ||
"ABC" | ||
], | ||
"Header2:control": { | ||
"element_count": 1 | ||
}, | ||
"Header3:control": { | ||
"must_not_exist": true | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "check HTTP header using control, use reverse_test_result", | ||
"request": { | ||
"server_url": "http://localhost:9999", | ||
"endpoint": "bounce-json", | ||
"method": "POST" | ||
}, | ||
"response": { | ||
// check number of HTTP headers, should always be > 0 | ||
"header:control": { | ||
"element_count": 0 | ||
} | ||
}, | ||
"reverse_test_result": true | ||
}, | ||
{ | ||
"name": "check value in HTTP header using control, use reverse_test_result", | ||
"request": { | ||
"server_url": "http://localhost:9999", | ||
"endpoint": "bounce-json", | ||
"method": "POST", | ||
"header": { | ||
"header1": "ABC" | ||
} | ||
}, | ||
"response": { | ||
"header": { | ||
// HTTP header should never exist twice | ||
"Content-Type:control": { | ||
"element_count": 2 | ||
} | ||
} | ||
}, | ||
"reverse_test_result": true | ||
} | ||
] | ||
} |