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

subtle pitfall in handleMatchMakeRequest and colyseus.js #328

Closed
amir-arad opened this issue Apr 24, 2020 · 3 comments
Closed

subtle pitfall in handleMatchMakeRequest and colyseus.js #328

amir-arad opened this issue Apr 24, 2020 · 3 comments

Comments

@amir-arad
Copy link

amir-arad commented Apr 24, 2020

Steps to Reproduce (for bugs)

  1. create a room using server-side matchMaker.create('space', {})
  2. join this room from browser from page http://localhost:8080 using colyseus.js:
new Client('ws:' + window.location.href.substring(window.location.protocol.length)).join('space')

The browser then sends a POST request to http://localhost:8080//matchmake/join/space. notice the double slash - a trailing slash was added to the client .endpoint somewhere along the way. The server parses the path accordingly (see here and here )
3. However, when I use the same code in an inner page http://localhost:8080/game1 the request goes to http://localhost:8080/game1/matchmake/join/space and the server catches it but answers with {"code":4210,"error":"invalid method \"matchmake\""}.

I'm pretty sure this was just introduced in 0.13.0 .

IMO all matchmakers requests should go to https://${client.endpoint}/matchmake/... (single slash), and the server should be more strict with its path tests.

@amir-arad
Copy link
Author

my local fix was using new Client('ws://' + window.location.host + '/')

@endel endel added this to 📚 Needs triage in Support / Maintenance Aug 19, 2021
@endel endel moved this from 📚 Needs triage to ↓ Low priority in Support / Maintenance Aug 19, 2021
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 28, 2021
@github-actions
Copy link

github-actions bot commented Sep 4, 2021

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Sep 4, 2021
Support / Maintenance automation moved this from ↓ Low priority to ✓ Closed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

1 participant