cors-filter
cors-filter copied to clipboard
POST without Content-Type -> INVALID_CORS correct?
I'm using version 1.0.1, which rejects a POST request without Content-Type (because there is no content) as requestType=INVALID_CORS.
This is because the if()-block in CORSFilter.java#631 has no else branch:
if (contentType != null) {
contentType = contentType.toLowerCase().trim();
if (SIMPLE_HTTP_REQUEST_CONTENT_TYPE_VALUES
.contains(contentType)) {
requestType = CORSRequestType.SIMPLE;
} else {
requestType = CORSRequestType.ACTUAL;
}
}
wouldn't it be correct to add...
} else { // contentType == null
requestType = CORSRequestType.ACTUAL;
}
... so that POST requests without Content-Type are ACTUAL rather than INVALID_CORS?