Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-Get request in proxy dev-mode #129

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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