diff --git a/src/main/scala/ai/diffy/proxy/HttpEndpoint.java b/src/main/scala/ai/diffy/proxy/HttpEndpoint.java index 391eab0..ace5f43 100644 --- a/src/main/scala/ai/diffy/proxy/HttpEndpoint.java +++ b/src/main/scala/ai/diffy/proxy/HttpEndpoint.java @@ -22,7 +22,7 @@ public class HttpEndpoint extends IndependentEndpoint } if(req.isFormUrlencoded() && HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED - .equals(req.requestHeaders().get(HttpHeaderNames.CONTENT_TYPE))){ + .contentEquals(req.requestHeaders().get(HttpHeaderNames.CONTENT_TYPE))){ throw new RuntimeException("Content-Type : application/x-www-form-urlencoded is not supported"); } return req.receive().aggregate().asString().toFuture().thenApply(body -> new HttpRequest( diff --git a/src/test/scala/ai/diffy/HttpHeaderValuesTest.java b/src/test/scala/ai/diffy/HttpHeaderValuesTest.java new file mode 100644 index 0000000..05f49ab --- /dev/null +++ b/src/test/scala/ai/diffy/HttpHeaderValuesTest.java @@ -0,0 +1,12 @@ +package ai.diffy; + +import io.netty.handler.codec.http.HttpHeaderValues; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class HttpHeaderValuesTest { + @Test + public void urlEncodedHeader() { + assertTrue(HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED.contentEquals("application/x-www-form-urlencoded")); + } +}