Commit 7f7b546
committed
add RackMapped adapter that correctly handles routing when hosted from a rack mapped URI
`Webmachine::Adapters::RackMapped` is implemented as a subclass of
`Webmachine::Adapters::Rack`, and simply overrides the way the
`Webmachine::Request` is built to explicitly set the `routing_tokens`
from the rack request `PATH_INFO` string - rather than from the full
uri path string as the base rack adapter does.
Rack provides the path that the app should use in the `PATH_INFO` env
var. This is the correct value to use for routing etc to work with
mapped apps.
Note, this was done as a separate class as suggested by @bethesque to
preserve backward compatibility. If any webmachine apps are running as
mapped rack apps already, they may have gotten around not being able to
host the app on a mapped path by specifying the full URI path in the
routing config - which would no longer work if this change was made on
the base rack adapter.1 parent 7e9cd6a commit 7f7b546
File tree
2 files changed
+54
-4
lines changed- lib/webmachine/adapters
- spec/webmachine/adapters
2 files changed
+54
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 62 | + | |
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
| |||
95 | 92 | | |
96 | 93 | | |
97 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| |||
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
170 | 186 | | |
171 | 187 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
| |||
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
0 commit comments