Skip to content

Commit

Permalink
Added warning if a header listed in SignedHeaders is missing from req…
Browse files Browse the repository at this point in the history
…uest
  • Loading branch information
streiwil committed Sep 27, 2019
1 parent ea41a35 commit 43619f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/burp/Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ public static byte[] signRequest(IHttpRequestResponse messageInfo,

StringBuilder canonicalHeaders = new StringBuilder();

for (String signedHeader : signedHeaderList){
canonicalHeaders.append(signedHeader.toLowerCase()).append(':').append(headerMap.get(signedHeader)).append('\n');
for (String signedHeader : signedHeaderList) {
if (headerMap.containsKey(signedHeader)) {
canonicalHeaders.append(signedHeader.toLowerCase()).append(':').append(headerMap.get(signedHeader)).append('\n');
} else {
pw.println("Warning: SignedHeader '" + signedHeader + "' does not exist in request headers.");
}
}

byte[] request = messageInfo.getRequest();
Expand Down

0 comments on commit 43619f1

Please sign in to comment.