/** * Checks if the transport is of the correct content type. * * @param transport transport being evalauted * * @throws SecurityPolicyException thrown if the content type was an unexpected value */ protected void evaluateContentType(HTTPTransport transport) throws SecurityPolicyException { String transportContentType = transport.getHeaderValue("Content-Type"); if (requiredContentType != null && !transportContentType.startsWith(requiredContentType)) { log.error("Invalid content type, expected " + requiredContentType + " but was " + transportContentType); throw new SecurityPolicyException("Invalid content type, expected " + requiredContentType + " but was " + transportContentType); } }