question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to customize Access-Control-Allow-Headers passed to matchmake endpoint

See original GitHub issue

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)

  1. Enable any instrumentation library that add new headers to allow for CORS tracing
  2. Matchmake does not work anymore as we requested more headers than what was returned

See screenshot:

image

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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JCMaiscommented, Jun 16, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found