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

Send X-Cors-Proxy-Allowed-Request-Headers header on proxied requests #238

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

maxschmeling
Copy link
Contributor

@maxschmeling maxschmeling commented Dec 12, 2024

With the release of WordPress/wordpress-playground#2007 we're able to explicitly enable the Authorization header on the CORS proxy. This allows us to make authenticated requests to APIs.

Copy link
Member

@chriszarate chriszarate left a comment

Choose a reason for hiding this comment

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

Looks good, in the future maybe this could actually respond to the headers in the request. It might look a little squirrelly on requests that don't need it

@maxschmeling
Copy link
Contributor Author

Looks good, in the future maybe this could actually respond to the headers in the request. It might look a little squirrelly on requests that don't need it

I briefly considered two different options:

  1. Stripping it off in the proxy so the X-Cors-Proxy-Allowed-Request-Headers header never gets passed through.
  2. Doing what you suggest and not sending it to the proxy if the request doesn't contain the Authorization header.

But I figured the less logic we add to it, the better. However, I'm definitely still open to either option.

@maxschmeling maxschmeling merged commit 189473d into trunk Dec 13, 2024
11 checks passed
@maxschmeling maxschmeling deleted the add/cors-proxy-auth-support branch December 13, 2024 04:45
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