Skip to content

Commit 958bb06

Browse files
committed
Fix CORS problem in case of OPTION requests on read only topics (#555)
1 parent 3f3ca4c commit 958bb06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/src/main/java/io/kafbat/ui/config/ReadOnlyModeFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public class ReadOnlyModeFilter implements WebFilter {
3333
@NotNull
3434
@Override
3535
public Mono<Void> filter(ServerWebExchange exchange, @NotNull WebFilterChain chain) {
36-
var isSafeMethod = exchange.getRequest().getMethod() == HttpMethod.GET;
36+
var isSafeMethod =
37+
exchange.getRequest().getMethod() == HttpMethod.GET || exchange.getRequest().getMethod() == HttpMethod.OPTIONS;
3738
if (isSafeMethod) {
3839
return chain.filter(exchange);
3940
}

0 commit comments

Comments
 (0)