Don't require an Origin header #10

Open
codebutler opened this Issue Mar 30, 2012 · 5 comments

Comments

Projects
None yet
4 participants

Protocol::WebSocket currently requires the 'Origin' header. https://github.com/vti/protocol-websocket/blob/master/lib/Protocol/WebSocket/Request.pm#L356

The websocket RFC says:

This header field is sent by browser clients; for non-browser
   clients, this header field may be sent if it makes sense in the
   context of those clients.

... implying that this field is optional. Some non-browser websocket clients (such as Faye) don't send this header by default, causing the handshake with a Protocol::WebSocket-based server to hang forever.

Owner

vti commented Mar 31, 2012

Do you know how Faye knows that connection is via ssl? For example, when Origin is available I look into URL and check if https is present. How is this done when there is no Origin header?

Contributor

leedo commented Sep 4, 2012

This looks related to a warning I am getting from a number of users:

Use of uninitialized value in pattern match (m//) at /home/drpizza/catlady/../alice/extlib/lib/perl5/Protocol/WebSocket/Request.pm line 375, <> line 10.

I assume some clients aren't sending an Origin header and it blows up here:

$self->secure(1) if $self->origin =~ m{^https:};
Owner

vti commented Sep 4, 2012

Will look into it again.
04.09.2012 20:17 ÐÏÌØÚÏ×ÁÔÅÌØ "Lee Aylward" notifications@github.com
ÎÁÐÉÓÁÌ:

This looks related to a warning I am getting from a number of users:

Use of uninitialized value in pattern match (m//) at /home/drpizza/catlady/../alice/extlib/lib/perl5/Protocol/WebSocket/Request.pm line 375, line 10.

I assume some clients aren't sending an Origin header and it blows up here:

$self->secure(1) if $self->origin =~ m{^https:};

--
Reply to this email directly or view it on GitHubhttps://github.com/vti/protocol-websocket/issues/10#issuecomment-8271181.

Contributor

BlueT commented Oct 23, 2012

I'm having the same issue when running PocketIO test in it's example.
Use of uninitialized value in pattern match (m//) at /home/matthew/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Protocol/WebSocket/Request.pm line 375, <> line 14.

Owner

vti commented Dec 30, 2012

It is fixed now? :)

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