Commit 9112e2f
committed
Allow the Dispatcher to set is_behind_proxy for Core::Request:
Currently, Core::Request's is_behind_proxy is set by Core::App
whenever a new Core::Context is provided (using a trigger, no less).
There are various problems with this:
* The App shouldn't care about is_behind_proxy
* The attribute shouldn't be set every time, since it's global
* Core::Context is unrelated to this
Instead, we made behind_proxy a global variable (as done by
GH #590) with its own trigger. Then it is set on instantiation by
Core::Dispatcher.
Then we can remove Core::App's _init_for_context method completely.
GH #590 approaches this issue in an entirely different and better
way, by suggesting we simply correct the environment before all
of this happens using a middleware.
For now we're just doing enough to untangle Core::Context more.1 parent 32d772f commit 9112e2f
File tree
4 files changed
+10
-14
lines changed- lib/Dancer2/Core
- Role
4 files changed
+10
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | 257 | | |
260 | 258 | | |
261 | 259 | | |
| |||
419 | 417 | | |
420 | 418 | | |
421 | 419 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 420 | | |
432 | 421 | | |
433 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
| 374 | + | |
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
0 commit comments