Skip to content

Commit

Permalink
Fix non-Get request in proxy dev-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jul 1, 2022
1 parent 8c45039 commit 2ce7770
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkiverse.quinoa.test.devmode;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;

import org.hamcrest.Matchers;
Expand All @@ -9,6 +10,7 @@

import io.quarkus.test.QuarkusDevModeTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;

public class ForwardedDevModeTest {
@RegisterExtension
Expand All @@ -27,5 +29,10 @@ public void testWebUI() {
.statusCode(200)
.header("Content-Encoding", Matchers.nullValue())
.body(is("live-coding\n"));
given()
.body("{}")
.contentType(ContentType.JSON)
.when().post("/api/something").then()
.statusCode(404);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static io.quarkiverse.quinoa.QuinoaRecorder.isIgnored;
import static io.quarkiverse.quinoa.QuinoaRecorder.next;
import static io.quarkiverse.quinoa.QuinoaRecorder.resolvePath;
import static io.quarkiverse.quinoa.QuinoaRecorder.shouldHandleMethod;

import java.util.List;

Expand Down Expand Up @@ -42,6 +43,10 @@ class QuinoaDevProxyHandler implements Handler<RoutingContext> {

@Override
public void handle(final RoutingContext ctx) {
if (!shouldHandleMethod(ctx)) {
next(currentClassLoader, ctx);
return;
}
String path = resolvePath(ctx);
if (isIgnored(path, config.ignoredPathPrefixes)) {
next(currentClassLoader, ctx);
Expand Down

0 comments on commit 2ce7770

Please sign in to comment.