Skip to content

Commit 6b2f6b8

Browse files
author
Chris Wiechmann
committed
Content-Type header could not be found is not logged on DEBUG instead of DATA
1 parent 7e243ac commit 6b2f6b8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.4.1] 2022-06-09
8+
### Changed
9+
- If content-type header could not be found is not logged on DEBUG instead of DATA [#7](https://github.com/Axway-API-Management-Plus/openapi-validator/issues/7)
10+
711
## [1.4.0] 2022-03-28
812
### Fixed
913
- Making access to the validation report documented and easier [#5](https://github.com/Axway-API-Management-Plus/openapi-validator/issues/5)

src/main/java/com/axway/apim/openapi/validator/Utils.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ public static Collection<String> getHeaderValues(HeaderSet headers, String name)
8484
if(headers==null) return result;
8585
HeaderEntry headerValues = headers.getHeaderEntry(name);
8686
if(headerValues==null) {
87+
// Check if the requested header was the content-type header which we default to application/json
8788
if(name.toLowerCase().equals("content-type")) {
88-
// For any reason, sometime the API-Gateway at runtime removes the Content-Type header from the attribute http.headers
89-
traceMessage("Header: Content-Type not found. Defaulting to application/json.", TraceLevel.INFO);
89+
// For any reason, sometimes the API-Gateway at runtime removes the Content-Type header from the attribute http.headers
90+
traceMessage("WARN - Header: Content-Type not found. Defaulting to application/json.", TraceLevel.DEBUG);
9091
result.add("application/json");
9192
return result;
9293
} else {
94+
traceMessage("Header: "+name+" not found.", TraceLevel.DEBUG);
9395
return result; // Header might not be set
9496
}
9597
}

0 commit comments

Comments
 (0)