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

WebSocket handshake has no referrer #8280

Merged
merged 2 commits into from
Nov 17, 2017
Merged

WebSocket handshake has no referrer #8280

merged 2 commits into from
Nov 17, 2017

Conversation

annevk
Copy link
Member

@annevk annevk commented Nov 16, 2017

@ghost
Copy link

ghost commented Nov 16, 2017

Build PASSED

Started: 2017-11-17 12:38:52
Finished: 2017-11-17 12:42:00

View more information about this build on:

ws.onmessage = t.step_func_done(e => {
assert_equals(e.data, "MISSING AS PER FETCH");
ws.close();
});
Copy link
Member

Choose a reason for hiding this comment

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

You can do this to avoid timeouts

  ws.onclose = t.unreached_func('close');
  ws.onerror = t.unreached_func('error');

Locally I get an error event with chrome canary running referrer.any.html. I haven't debugged why that is. Can you reproduce though?

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot, Chrome 64.0.3271.0 on macOS.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see what I did wrong. I didn't restart wptserve after checking out your branch, so the websocket handler /referrer didn't exist. Sorry. Now it passes for me locally.

Copy link
Member Author

@annevk annevk Nov 17, 2017

Choose a reason for hiding this comment

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

Ah yeah, took me a while to figure that one out too.


def web_socket_transfer_data(request):
referrer = request.headers_in.get("Referer")
if not referrer:
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be if referrer is None, at least other handlers use that form and I vaguely recall changing to more explicit None checks for some reason.

@annevk annevk merged commit 77c379b into master Nov 17, 2017
@annevk annevk deleted the annevk/ws-referrer branch November 17, 2017 15:07
annevk added a commit to whatwg/fetch that referenced this pull request Nov 17, 2017
Copy link
Contributor

@tyoshino tyoshino left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants