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

DevUICORSFilter - Do not log errors for Chrome extensions #45547

Merged
merged 1 commit into from
Jan 14, 2025
Merged
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
Expand Up @@ -25,6 +25,7 @@ public class DevUICORSFilter implements Handler<RoutingContext> {
private static final String HTTPS_LOCAL_HOST = "https://" + LOCAL_HOST;
private static final String HTTP_LOCAL_HOST_IP = "http://" + LOCAL_HOST_IP;
private static final String HTTPS_LOCAL_HOST_IP = "https://" + LOCAL_HOST_IP;
private static final String CHROME_EXTENSION = "chrome-extension://";

public DevUICORSFilter() {
}
Expand Down Expand Up @@ -53,7 +54,9 @@ public void handle(RoutingContext event) {
|| origin.startsWith(HTTP_LOCAL_HOST_IP) || origin.startsWith(HTTPS_LOCAL_HOST_IP)) {
corsFilter().handle(event);
} else {
LOG.errorf("Only localhost origin is allowed, but Origin header value is: %s", origin);
if (!origin.startsWith(CHROME_EXTENSION)) {
LOG.errorf("Only localhost origin is allowed, but Origin header value is: %s", origin);
}
response.setStatusCode(403);
response.setStatusMessage("CORS Rejected - Invalid origin");
response.end();
Expand Down
Loading