Commit 57e77b7
committed
Set secure cookies on interleaved http/https calls correctly
The current HTTP/HTTPS detection code mutates the cookie config in place
in order to switch between secure and non-secure cookies. However, since
the original global secure_headers config was passed around everywhere,
the very first HTTP request received would modify the global cookie
config, resulting in :secure => false for all subsequent requests
regardless of SSL. The solution is to dup the cookie config before using
it, which is a pattern followed for every other configuration type
anyways; a better long-term fix would be using non-mutating methods
instead.1 parent df03646 commit 57e77b7
File tree
3 files changed
+14
-2
lines changed- lib/secure_headers
- spec/lib/secure_headers
3 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
0 commit comments