Allow to customize Access-Control-Allow-Headers passed to matchmake endpoint
See original GitHub issueIssue Description
The value is currently static here: https://github.com/colyseus/colyseus/blob/bdf43169e509e0fd2305cd4a3b3669e7bf733c76/packages/core/src/Server.ts#L236-L247
If you use an instrumentation library (such as newrelic) it may add new headers , right now this is broken
Steps to Reproduce (for bugs)
- Enable any instrumentation library that add new headers to allow for CORS tracing
- Matchmake does not work anymore as we requested more headers than what was returned
See screenshot:
Notice the requested headers (Access-Control-Request-Headers
) and the ones returned in the response (Access-Control-Allow-Headers
)
Context
Trying to enable the NewRelic browser monitoring agent
Your Environment
- Colyseus Version: v0.14.20
- Node.js Version: v14
- Operating System and version: Ubuntu
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Access-Control-Allow-Headers - HTTP - MDN Web Docs
The Access-Control-Allow-Headers response header is used in ... It indicates that a custom header named X-Custom-Header is supported by CORS ...
Read more >Access-Control-Allow-Headers is set but impossible to get ...
On the server side, this custom response header was added in the Access-Control-Allow-Headers header. Applied response headers.
Read more >Configuring CORS - Apollo GraphQL Docs
The Access-Control-Allow-Origin header (ACAO) enables a server to dictate which origins can use scripts to access that server's resources. Depending on what you ......
Read more >Add custom header to Access-Control-Allow-Headers - Support
The Access-Control-Allow-Headers response header is used in response to a preflight request which includes the Access-Control-Request-Headers to ...
Read more >The Access-Control-Allow-Origin Header Explained
Access-Control-Allow-Origin is a CORS header. CORS, or Cross Origin Resource Sharing, is a mechanism for browsers to let a site running at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @JCMais, this has been taken care of on the upcoming 0.15 version 🤞 https://github.com/colyseus/colyseus/blob/3d6624239fa89e856aea2d1b82ac49d8647aedbb/packages/transport/uwebsockets-transport/src/uWebSocketsTransport.ts#L179
@endel I saw you added a way to configure it, ty for that!
I noticed a similar change needs to be done to the uWebSocketsTransport, as it handles the cors headers separately.