On Linux (and I can only imagine on other platforms) `curl -I https://example.com` will output the headers with the caret return (\r) character at the end.
-
On Linux (and I can only imagine on other platforms) `curl -I https://example.com` will output the headers with the caret return (\r) character at the end.
So if you're piping it, say, into `sed` with a regex that matches the end of the line with `$`, you might want to do `\r$` instead.
You know, if you want it to work as expected.
That was a weird Bash script bug to figure out, that's for sure.
-
Riley S. Faelanreplied to Michał "rysiek" Woźniak · 🇺🇦 last edited by
@rysiek Not a Linux thing. HTML specification says that you're supposed to use CR LF in the wire protocol. Curl just carries it over when the server does that, which most do, because there's benefits to being 8-bit clean.
-
@rysiek sorry, s/HTML/HTTP/. HTML doesn't care; HTTP specifies CR LF.
Copyright © 2024 NodeBB | Contributors