Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle /app_profiler/ index path with slash in speedscope remote viewer middleware #39

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

shioyama
Copy link
Member

I was confused when I tried accessing /app_profiler/ and got the following error:

Puma caught this error: ArgumentError (ArgumentError)
/usr/local/bundle/bundler/gems/app_profiler-7017e16d966a/lib/app_profiler/viewer/speedscope_remote_viewer/middleware.rb:33:in `show'
/usr/local/bundle/bundler/gems/app_profiler-7017e16d966a/lib/app_profiler/viewer/speedscope_remote_viewer/base_middleware.rb:31:in `call'
...

The problem is that the middleware only accepts /app_profiler and not /app_profiler/ as the path, the latter is treated as a path to an actual profiler with a name value of "", which crashes with the exception above.

I just made a change to optionally accept /app_profiler/ as well.

@shioyama shioyama changed the title Handle app_profiler index path with slash Handle /app_profiler/ index path with slash in speedscope remote viewer middleware Nov 11, 2021
@shioyama shioyama merged commit d1ea95d into main Nov 11, 2021
@shopify-shipit shopify-shipit bot temporarily deployed to production March 2, 2022 15:30 Inactive
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants