logoalt Hacker News

xp84today at 3:10 AM3 repliesview on HN

I love the hilarious output. He even coded in a special case for just a question mark without any params:

https://chrismorgan.info/no-query-strings?

Never have I seen such a sassy web server


Replies

varenctoday at 5:15 AM

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 https://chrismorgan.info///no-query-strings

digression: I love trying "domain.com//" on various sites. Occasionally it'll trigger weird errors like a 502 or 500.

show 1 reply
chrismorgantoday at 7:37 AM

I also contemplated making it serve the content of the original page, but with every . and ! turned to ? (or maybe ! changed to ‽). But I decided that was too hard at present. I might revisit it later, there’s a stage in my plans where that will be easier to implement.

qingcharlestoday at 7:08 AM

You exposed a (useful) quirk in HN's URL parsing, though... :p

show 1 reply