Live data from Hacker News

I’ve banned query strings

chrismorgan.info

311–317 of 317 posts

Re: I’ve banned query strings

#311

Earlier quoted context omitted.

But the path misses param names (or types?). E.g who said the hex-encoded part is a commit hash? Maybe it's a tree hash, or just weird ref. Query strings are more verbose as force to give each param a name.

Which target audience of github needs extra verbosity in the commit hash, though? Once you know it you know it; if you don’t know git you aren’t the target audience; etc. Saying /user=foo is no better than ?user=foo if your audience can work it out without confusion from your unadorned paths. We have a great deal of history with filesystems showing that people are capable of keeping up with paths that lack key names…

> Saying /user=foo is no better than ?user=foo

I mean /foo vs ?user=foo

I know git enough, there's more than one type of hashes -- object hashes, tree hashes.

Re: I’ve banned query strings

#312
post #68

Earlier quoted context omitted.

My website has search without a query string: https://www.jeremykun.com/

Nice blog, but that's user hostile for a lot of products with search features. People share links pretty regularly.

Nothing stops someone from sharing a link to the blog or any individual page...

Re: I’ve banned query strings

#313

Earlier quoted context omitted.

"You could argue that I’m abusing 414 URI Too Long. I respond that it’s funnier this way. Other options I considered were: 400 Bad Request, the generic client error code, which is correct but boring; 402 Payment Required, and honestly if you want to pay me to make a particular URL with query string work, I’m open to it; 404 Not Found, but it’s too likely to have side effects, and it doesn’t convey the idea that the r…

Also from the 414 page: >Complain to whoever gave you the bad link, and ask them to stop modifying URLs, because it’s bad manners. It's ironic that an error response so blatantly violating the robustness principle is throwing shade about bad manners.

The robustness principle is a terrible idea. Because people follow it, we have broken stuff all over the place.

Re: I’ve banned query strings

#314
post #312

Earlier quoted context omitted.

Nice blog, but that's user hostile for a lot of products with search features. People share links pretty regularly.

Nothing stops someone from sharing a link to the blog or any individual page...

Not all software is a blog.

Re: I’ve banned query strings

#315

Instead of throwing up an error response wouldn’t he achieve more desirable results from redirecting the address to the same address but without the query string.

this does not achieve the same result. By throwing an error, the person using that url needs to remove the querystring if they want share the link.

Re: I’ve banned query strings

#316
post #195

Earlier quoted context omitted.

great spot! I noticed that his server also doesn't accept URLs ending is a single `/`: https://chrismorgan.info/no-query-strings/ But instead of the banned query strings message, it just returns a very sassy not-a-404 page. Once again, this is violating a common convention, but there's nothing in the HTTP spec that requires treating these URLs the same. Similarly the site also 404s when you add extra slashes like htt…

You’re misreading a couple of things. There’s no violation of common convention where you’re pointing. Where dealing with static file servers: For URLs that are supposed to include a trailing slash and the server will find that directory and serve its index.html: it’s customary, though not ubiquitous, to redirect from no-slash to slash. (Some, including popular commercial services, serve the index.html file instead o…

I've seen a lot of headaches caused by that trailing dot in the past! IIRC Caddy specifically said they wouldn't support that, leading to a medium-sized flamewar in an issue or PR.

Clearly the trailing dot is theoretically highly appropriate, but it seems like we're so far down the opposite path that we should all agree that every domain, sadly, should always be fully qualified.

Re: I’ve banned query strings

#317

> curl, for example, seems to illegitimately strip a trailing question mark (could be only for the command line, didn’t test library usage). umm what? I don't know what they're actually sending where they think this, but if you think curl is broken you should re-think that maybe you're the one doing something wrong. Here are some examples showing curl not stripping question marks (obviously), I am very curious what t…

$ curl -s 'https://httpbingo.org/get?' | jq .url "https://httpbingo.org/get" This may require further investigation.

bagder merged a fix to curl in response to my report: https://github.com/curl/curl/commit/b079595f2e903b820a027a68...

Sorry for not believing you initially! I'm very surprised that was in there

Post reply on HN