We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Support '%2F' (escaped forward slash) in URLs. AllowEncodedSlashes must be 
turned on. Fixes issue #113, thanks adam.hooper.
Hongli Lai (Phusion) (author)
Wed Aug 20 01:07:31 -0700 2008
commit  8d9de8602ac240258d74101cb0000d099bb8059f
tree    2f9176d9402180a4080d600cb874d9a7504c7c17
parent  274d05b6c8a85f66b79f0ec8338f7cfcd51f0939
...
544
545
546
547
 
548
549
550
...
544
545
546
 
547
548
549
550
0
@@ -544,7 +544,7 @@ private:
0
     addHeader(headers, "REMOTE_PORT", apr_psprintf(r->pool, "%d", r->connection->remote_addr->port));
0
     addHeader(headers, "REMOTE_USER", r->user);
0
     addHeader(headers, "REQUEST_METHOD", r->method);
0
- addHeader(headers, "REQUEST_URI", r->uri);
0
+ addHeader(headers, "REQUEST_URI", r->unparsed_uri);
0
     addHeader(headers, "QUERY_STRING", r->args ? r->args : "");
0
     if (strcmp(baseURI, "/") != 0) {
0
       addHeader(headers, "SCRIPT_NAME", baseURI);
...
80
81
82
83
 
 
 
 
 
 
 
 
 
84
85
86
...
80
81
82
 
83
84
85
86
87
88
89
90
91
92
93
94
0
@@ -80,7 +80,15 @@ shared_examples_for "MyCook(tm) beta" do
0
     response = get_response('/welcome/headers_test')
0
     response["X-Foo"].should == "Bar"
0
   end
0
-
0
+
0
+ it "supports %2f in URIs" do
0
+ get('/welcome/show_id/foo%2fbar').should == 'foo/bar'
0
+ end
0
+
0
+ it "has AbstractRequest which returns a request_uri without hostname, with query_string" do
0
+ get('/welcome/request_uri?foo=bar%20escaped').should =~ %r{/welcome/request_uri\?foo=bar%20escaped}
0
+ end
0
+
0
   it "supports restarting via restart.txt" do
0
     begin
0
       controller = "#{@stub.app_root}/app/controllers/test_controller.rb"
...
71
72
73
 
74
75
76
...
71
72
73
74
75
76
77
0
@@ -71,6 +71,7 @@ CustomLog <%= @server_root %>/access.log combined
0
   <VirtualHost *:<%= @port %>>
0
     ServerName <%= vhost.domain %>
0
     DocumentRoot "<%= vhost.document_root %>"
0
+ AllowEncodedSlashes On
0
     <% for line in vhost.additional_configs %>
0
       <%= line %>
0
     <% end %>
...
36
37
38
 
 
 
 
 
 
 
 
39
...
36
37
38
39
40
41
42
43
44
45
46
47
0
@@ -36,4 +36,12 @@ class WelcomeController < ApplicationController
0
   def terminate
0
     exit!
0
   end
0
+
0
+ def show_id
0
+ render :text => params[:id]
0
+ end
0
+
0
+ def request_uri
0
+ render :text => request.request_uri
0
+ end
0
 end

Comments

    No one has commented yet.