Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

policy request regex was too general (maybe) #1

Merged
2 commits merged into from over 3 years ago

2 participants

istinkatruby Dan Simpson
istinkatruby

I swapped out the regex for the more specific one from the em-websocket dudes and incremented the version by 0.0.1. With Chrome 7 Beta at least, something involved in the handshake was sending the '<' character about 30% of the time.

Disclaimer: I be a ruby noob. :)

added some commits October 28, 2010
Dan Simpson
Owner

I'm supprised that chrome was sending < in the HTTP request header. Can you reproduce the problem and send me the request data? I'd like to see it. However, your regex is more complete and I will pull it in.

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

Showing 2 unique commits by 1 author.

Oct 28, 2010
Changed policy request regex 6431046
Incrememnted version 1d353b4
This page is out of date. Refresh to see the latest.
2  em-websocket-server.gemspec
... ...
@@ -1,6 +1,6 @@
1 1
 spec = Gem::Specification.new do |s|
2 2
   s.name = 'em-websocket-server'
3  
-  s.version = '0.15'
  3
+  s.version = '0.15.1'
4 4
   s.date = '2010-08-30'
5 5
   s.summary = 'An evented ruby websocket server built on top of EventMachine'
6 6
   s.email = "dan.simpson@gmail.com"
4  lib/em-websocket-server/server.rb
@@ -69,7 +69,7 @@ def receive_data data
69 69
             on_receive msg.gsub(Frame, "")
70 70
           end
71 71
         else        
72  
-          if data =~ /</
  72
+          if data =~ /\A<policy-file-request\s*\/>/
73 73
             Log.debug "Sending flash policy #{self.class.policy_content}"
74 74
             send_data self.class.policy
75 75
             close_connection_after_writing
@@ -154,4 +154,4 @@ def default_policy
154 154
       end
155 155
     end
156 156
   end
157  
-end
  157
+end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.