AnilKumarHurkadli commented on a change in pull request #869:
URL: https://github.com/apache/cxf/pull/869#discussion_r742014433
##########
File path:
rt/rs/security/http-signature/src/test/java/org/apache/cxf/rs/security/httpsignature/MessageVerifierTest.java
##########
@@ -51,6 +51,7 @@
private static final String METHOD = "GET";
private static final String URI = "/test/signature";
private static final String KEY_PAIR_GENERATOR_ALGORITHM = "RSA";
+ private static final String MESSAGE_BODY = "Hello";
Review comment:
@reta Sure will add the test case for which
InvalidDataToVerifySignatureException will not be thrown if the body is null
and passes fine. The issue was encountered specifically while testing DELETE
method which "usually" do not have body and "Digest" header gets added by
default in the required headers and is NOT removed as it was not satisfying
below condition
if ((requestor && (status < 200 || status >= 300 || status == 204))
|| (!requestor && ("GET".equalsIgnoreCase(method) ||
"HEAD".equalsIgnoreCase(method)))) {
signedHeaders.remove("digest");
}
And was throwing InvalidDataToVerifySignatureException with message "Not all
of the required headers are signed"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]