Repository navigation
Commit facf3cb
authored
fix: don't decode application/octet-stream as text when charset is utf-8 (#823)
getResponseData() treats any response carrying charset=utf-8 as text, even
application/octet-stream — the canonical "arbitrary binary" media type
(RFC 2046). Binary content (e.g. a raw binary file fetched with
mediaType: { format: "raw" }) is therefore run through response.text() and
mangled instead of being returned as an ArrayBuffer.
Exclude application/octet-stream from the charset-based text branch so it
falls through to arrayBuffer(). Genuinely textual responses (text/* and
other charset=utf-8 types such as application/vnd.github.v3.raw) are
unaffected.
Refs #7511 parent 554e102 commit facf3cb
2 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
409 | 436 | | |
410 | 437 | | |
411 | 438 | | |
| |||
0 commit comments