Skip to content

Commit 3234496

Browse files
author
Chris Wiechmann
committed
Merge http.content.headers into http.headers
Fixes #7
1 parent 01d0c65 commit 3234496

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def invoke(msg)
4545
def verb = msg.get("http.request.verb");
4646
def queryParams = msg.get("params.query");
4747
def headers = msg.get("http.headers");
48+
def contentHeaders = msg.get("http.content.headers");
4849
try {
50+
// Content-Headers contains the required Content-Type header - Merge them into the headers attribute
51+
headers.addHeaders(contentHeaders);
4952
// Call the validator itself
5053
def rc = validator.isValidRequest(payload, verb, path, queryParams, headers);
5154
Trace.info('rc: ' + rc);
@@ -96,8 +99,11 @@ def invoke(msg)
9699
def verb = msg.get("http.request.verb");
97100
def status = msg.get("http.response.status");
98101
def headers = msg.get("http.headers");
102+
def contentHeaders = msg.get("http.content.headers");
99103
Trace.debug('Calling OpenAPIValidator: [path: ' + path + ', verb: ' + verb + ', status: ' + status + ']');
100104
try {
105+
// Content-Headers contains the required Content-Type header - Merge them into the headers attribute
106+
headers.addHeaders(contentHeaders);
101107
def rc = validator.isValidResponse(payload, verb, path, status, headers);
102108
return rc;
103109
// If you would like to return the validation messages, use the following method, that returns you a

0 commit comments

Comments
 (0)