Commit b4d0f73
committed
fix(exit-node): fix double-wrapped response envelope in relay path (#1022)
Fixes #1022 -- exit-node-routed requests returned raw {s,h,b} JSON
to the browser instead of actual page content.
Root cause: Code.gs had no raw-return handler. The Rust client sets
r:true on the outer Apps Script request to signal verbatim passthrough,
but without a matching branch Code.gs was wrapping the exit node's
{s,h,b} response in a second {s,h,b} envelope. parse_exit_node_response()
peeled one layer and handed the inner {s,h,b} JSON string to the browser
as the body.
Code.gs (_doSingle):
- add req.r === true branch returning resp.getContentText() verbatim
via ContentService before the normal {s,h,b} wrap
- _buildOpts: followRedirects is now unconditionally true; r controls
raw-return mode only, not redirect following
domain_fronter.rs (parse_exit_node_response):
- scan for \r\n\r\n separator and skip any HTTP framing prefix before
JSON parsing; some Apps Script edge nodes prepend HTTP headers to the
response body
- add content-encoding to SKIP_RESPONSE_HEADERS; exit node fetch()
auto-decompresses so forwarding the header causes Content Encoding
Error in the browser1 parent 598a890 commit b4d0f73
2 files changed
Lines changed: 37 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | 164 | | |
168 | 165 | | |
169 | 166 | | |
| |||
184 | 181 | | |
185 | 182 | | |
186 | 183 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
212 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
213 | 203 | | |
214 | 204 | | |
215 | 205 | | |
| |||
307 | 297 | | |
308 | 298 | | |
309 | 299 | | |
310 | | - | |
| 300 | + | |
311 | 301 | | |
312 | 302 | | |
313 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2686 | 2686 | | |
2687 | 2687 | | |
2688 | 2688 | | |
2689 | | - | |
2690 | | - | |
2691 | | - | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
2692 | 2698 | | |
2693 | 2699 | | |
2694 | 2700 | | |
| |||
3961 | 3967 | | |
3962 | 3968 | | |
3963 | 3969 | | |
3964 | | - | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
3965 | 3977 | | |
3966 | 3978 | | |
3967 | 3979 | | |
3968 | | - | |
| 3980 | + | |
3969 | 3981 | | |
3970 | 3982 | | |
3971 | 3983 | | |
| |||
4001 | 4013 | | |
4002 | 4014 | | |
4003 | 4015 | | |
| 4016 | + | |
4004 | 4017 | | |
4005 | 4018 | | |
4006 | 4019 | | |
| |||
0 commit comments