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

[cors] Use JDK'S URI class for origin parsing #2138

Open
Playacem opened this issue Feb 24, 2024 · 1 comment · May be fixed by #2180
Open

[cors] Use JDK'S URI class for origin parsing #2138

Playacem opened this issue Feb 24, 2024 · 1 comment · May be fixed by #2180
Assignees

Comments

@Playacem
Copy link
Member

Playacem commented Feb 24, 2024

As suggested by @zugazagoitia in #2104, we should consider rewriting the custom host scheme port logic in the CORS plugin to use the JDK's URI class.

I plan to look into this next weekend.

Yes, it is. An IPv6 or a domain name (any string of characters) are valid origins.

The Origin header contains a scheme, host and optionally a port. The host, defined by the URI spec is not limited to TLDs, localhost or any internal DNS names are also valid, as well as IP literals.

@Playacem Playacem self-assigned this Feb 24, 2024
@zugazagoitia
Copy link
Member

I'm not sure how we can match using the URI class, it'll end up relying upon some manual parsing or regular expression, but we can use the URI class to normalize/validate non-wildcard URIs since they have already implemented the standard for us.

@Playacem Playacem linked a pull request Mar 4, 2024 that will close this issue
5 tasks
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 a pull request may close this issue.

2 participants