nushell/crates/nu-command/tests/commands/network/http
Bruce Weirdan e690e7aac0
Fallback to extension-based content type detection when parsing Content-Type header fails (#13610)
# Description

Previously when nushell failed to parse the content type header, it
would emit an error instead of returning the response. Now it will fall
back to `text/plain` (which, in turn, will trigger type detection based
on file extension).

May fix (potentially) nushell/nushell#11927

Refs:
https://discord.com/channels/601130461678272522/614593951969574961/1272895236489613366

Supercedes: #13609 

# User-Facing Changes

It's now possible to fetch content even if the server returns an invalid
content type header. Users may need to parse the response manually, but
it's still better than not getting the response at all.

# Tests + Formatting

Added a test for the new behaviour.

# After Submitting
2024-08-14 09:47:01 -05:00
..
delete.rs Use pipeline data for http post|put|patch|delete commands. (#13254) 2024-07-01 12:34:19 -07:00
get.rs Fallback to extension-based content type detection when parsing Content-Type header fails (#13610) 2024-08-14 09:47:01 -05:00
head.rs Allow http commands' automatic redirect-following to be disabled (#11329) 2023-12-28 15:26:34 +08:00
mod.rs add http options command (#9365) 2023-06-09 08:00:40 -05:00
options.rs add http options command (#9365) 2023-06-09 08:00:40 -05:00
patch.rs Use pipeline data for http post|put|patch|delete commands. (#13254) 2024-07-01 12:34:19 -07:00
post.rs Add multipart/form-data uploads (#13532) 2024-08-06 15:28:38 -05:00
put.rs Use pipeline data for http post|put|patch|delete commands. (#13254) 2024-07-01 12:34:19 -07:00