@Override public String getContentType() { return original.getContentType(); }
@Override public String getContentType() { return original.getContentType(); }
protected boolean isSimpleCORSRequest(RestxRequest req) { // see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS if (!SIMPLE_METHODS.contains(req.getHttpMethod())) { return false; } Optional<String> origin = req.getHeader("Origin"); if (!origin.isPresent()) { return false; } if ("POST".equals(req.getHttpMethod())) { if (!asList("application/x-www-form-urlencoded", "multipart/form-data", "text/plain") .contains(req.getContentType())) { return false; } } return true; }
protected boolean isSimpleCORSRequest(RestxRequest req) { // see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS if (!SIMPLE_METHODS.contains(req.getHttpMethod())) { return false; } Optional<String> origin = req.getHeader("Origin"); if (!origin.isPresent()) { return false; } if ("POST".equals(req.getHttpMethod())) { if (!asList("application/x-www-form-urlencoded", "multipart/form-data", "text/plain") .contains(req.getContentType())) { return false; } } return true; }
if ("application/x-www-form-urlencoded".equalsIgnoreCase(restxRequest.getContentType())) { out.println("Body was considered as parameter due to Content-Type: " + restxRequest.getContentType() + ". " + "Setting your Content-Type to \"application/json\" may resolve the problem"); } else { out.println("Empty body. Content-type was \"" + restxRequest.getContentType() + "\"");
if ("application/x-www-form-urlencoded".equalsIgnoreCase(restxRequest.getContentType())) { out.println("Body was considered as parameter due to Content-Type: " + restxRequest.getContentType() + ". " + "Setting your Content-Type to \"application/json\" may resolve the problem"); } else { out.println("Empty body. Content-type was \"" + restxRequest.getContentType() + "\"");