Changeset 2281 for branches/locker-dev/locker/deploy/bin/rails
- Timestamp:
- Aug 1, 2012, 12:43:13 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/locker-dev/locker/deploy/bin/rails
r2280 r2281 161 161 Thread.abort_on_exception = true 162 162 163 class Rack::PathInfoRewriter 163 # Strip public/dispatch.fcgi out of SCRIPT_NAME so Rails generates nicer URLs 164 class ScriptNameRewriter 165 164 166 def initialize(app) 165 167 \@app = app … … 167 169 168 170 def call(env) 169 env["SCRIPT_NAME"] = "" 170 parts = env['REQUEST_URI'].split('?') 171 env['PATH_INFO'] = parts[0] 172 env['QUERY_STRING'] = parts[1].to_s 171 if env['SCRIPT_NAME'] =~ /dispatch\.fcgi/ 172 env['SCRIPT_NAME'].gsub!(/public\\/dispatch\.fcgi/,'') 173 end 173 174 \@app.call(env) 174 175 end … … 180 181 181 182 begin 182 Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Rack::URLMap.new("/$appdir" => ${appclass}::Application, 183 "/" => ${appclass}::Application)) 183 Rack::Handler::FastCGI.run ScriptNameRewriter.new(Rack::URLMap.new("/" => ${appclass}::Application)) 184 184 rescue => e 185 185 dispatch_logger.error(e)
Note: See TracChangeset
for help on using the changeset viewer.