Skip to content

Commit 811ef53

Browse files
committed
Fix example for #16078
1 parent 155bdea commit 811ef53

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

blog/2025-09-02-nushell_0_107_0.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -471,21 +471,24 @@ Before, non-UTF-8 headers would be silently ignored. Now, these will cause an er
471471
In one Nushell instance, we create something resembling an HTTP server on port 1234:
472472

473473
```nu
474-
[("HTTP/1.1 200 OK\r\nContent-Length: 0\r\nx-header: "| into binary) 0x[1F FF AA AA] ("\r\n\r\n" | into binary)] | bytes collect |
474+
["HTTP/1.1 200 OK\r\nContent-Length: 0\r\nx-header: " 0x[1F FF AA AA] "\r\n\r\n"]
475+
| each { into binary }
476+
| bytes collect
477+
| ncat -l 1234
475478
```
476479

477480
In another instance, we connect to port 1234. The `x-header` is not valid UTF-8, which now produces an error:
478481

479-
```nushell
480-
http get --full --allow-errors http://localhost:1234
481-
# => Error: nu::shell::network_failure
482-
# =>
483-
# => × Network failure
484-
# => ╭─[entry #5:1:32]
485-
# => 1 │ http get --full --allow-errors http://localhost:1234
486-
# => · ──────────┬──────────
487-
# => · ╰── protocol: http parse fail: invalid header value
488-
# => ╰────
482+
```ansi
483+
[38;5;6m> [1;36mhttp get [34m--full --allow-errors [0m[32mhttp://localhost:1234[0m
484+
[39mError: [31mnu::shell::network_failure[0m
485+
486+
[31m× [39mNetwork failure[0m
487+
[39m╭─[[1;4;36mentry #1:1:1[0m[39m][0m
488+
[2;39m1 [0m[39m│ http get --full --allow-errors http://localhost:1234[0m
489+
[39m· [1;35m────┬───[0m
490+
[39m· [1;35m╰── protocol: http parse fail: invalid header value[0m
491+
[39m╰────[0m
489492
```
490493

491494
### Improved error messages for misspelled flags ([#16427](https://github.com/nushell/nushell/pull/16427))

0 commit comments

Comments
 (0)