Added check for the presence of Content-Type header in the request

This commit is contained in:
mghalbi 2023-02-24 10:45:09 +01:00 committed by Pedro Igor
parent fbf5541802
commit 116b2fed0c

View file

@ -59,6 +59,10 @@ public class HttpRequestImpl implements HttpRequest {
if (delegate == null) {
return null;
}
MediaType mediaType = getHttpHeaders().getMediaType();
if (mediaType.isCompatible(MediaType.valueOf("application/x-www-form-urlencoded"))) {
return new MultivaluedHashMap<>();
}
return delegate.getDecodedFormParameters();
}