getappmap / appmap-ruby

AppMap client agent for Ruby
https://appland.org
Other
100 stars 13 forks source link

Prevent environment mangling on Rails route resolution #330

Closed dividedmind closed 1 year ago

dividedmind commented 1 year ago

When an HTTP route goes to a rails engine, the router modifies the environment before passing it downstream. Since we're using the router to resolve the normalized path, in this case the environment could have been modified before rails stack actually got to see it, preventing it from routing the request correctly.

Using a clone of the environment to match the route prevents this problem, ensuring Rails stack gets an unmodified environment to do its own routing on it again. This fixes #329

This PR also fixes another problem I've found while trying to fix this.

kgilpin commented 1 year ago

:tada: This PR is included in version 0.99.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: