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

workaround for issue with CORS and Origin: null in vertx-web #711

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

jerojasro
Copy link
Contributor

The CORS handling mechanism of vertx-web should allow an HTTP header
with Origin: null, but currently it doesn't, and it causes requests to Kroki
with that header to fail; see vert-x3/vertx-web#1933
for the details.

This interferes with using Kroki in some scenarios, for example, using it
from a browser (javascript) in a webpage that is served from a file:// URL.

While that bug is fixed, this commit adds a workaround that enables
Kroki to handle that header value properly.

The workaround just defines a regexp that allows any value in that
header; vertx-web just matches the value using that regexp, and if it
matches the request continues its processing as normal.

Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks!
One minor nitpick to make sure that our future selves will understand why we did use .* instead of *.

Apart from that 👍🏻

@jerojasro jerojasro force-pushed the bugfix/null-origin branch from a8045e8 to 13bd9bf Compare April 28, 2021 00:04
The CORS handling mechanism of vertx-web should allow an HTTP header
with `Origin: null`, but currently it doesn't; see
vert-x3/vertx-web#1933 for the details.

While that bug is fixed, this commit adds a workaround that enables
Kroki to handle that header value properly.

The workaround just defines a regexp that allows any value in that
header; vertx-web just matches the value using that regexp, and if it
matches the request continues its processing as normal.
Copy link
Member

@ggrossetie ggrossetie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@ggrossetie ggrossetie merged commit d56b2fe into yuzutech:main Apr 28, 2021
@ggrossetie
Copy link
Member

Thanks @jerojasro !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants