Quantcast
Channel: Passenger/RackBaseURI issues with paths
Viewing all articles
Browse latest Browse all 3

Passenger/RackBaseURI issues with paths

$
0
0

@nspring wrote:

I'm having what I believe to be the same problem.

Changing base_url_path does direct the client to fetch includes.js and other resources from base_url_path/. However, serve_html in profiler.rb also uses seeks base_url_path as a prefix of the PATH_INFO being fetched. When using passenger with RackBaseURI/RailsBaseURI/PassengerBaseURI, the prefix is stripped before serve_html sees the url being fetched, so none of the profiler.rb code responds to requests.

The following ugly-patch works with base_url_path, you know, sort of. Also helpful (and much simpler) is to revert c12506234b47eea9446a083e20d49b65c166c9eb .

`
--- profiler.rb 2016-02-15 14:47:32.000000000 -0500
+++ /var/lib/gems/2.1.0/gems/rack-mini-profiler-0.9.8/lib/mini_profiler/profiler.rb 2016-02-15 14:55:32.000000000 -0500
@@ -113,7 +113,7 @@
end

     def serve_html(env)
-      file_name = env['PATH_INFO'][(@config.base_url_path.length)..1000]
+      file_name = env['PATH_INFO'][("/mini-profiler-resources/".length)..1000]

       return serve_results(env) if file_name.eql?('results')

@@ -175,7 +175,7 @@
       end

       # handle all /mini-profiler requests here
-      return serve_html(env) if path.start_with? @config.base_url_path
+      return serve_html(env) if path.start_with? @config.base_url_path or path.start_with? "/mini-profiler-resources/"

       has_disable_cookie = client_settings.disable_profiling?
       # manual session disable / enable

`

Read full topic


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images