Hacker News new | ask | show | jobs
by patrickyeon 2795 days ago
I got caught this weekend where I linked an image on Facebook, and it generated the preview properly but the link is broken because the host 404's with the added fbclid parameter.

I entered: https://pbs.twimg.com/media/Byv5uWSIIAEf38C.jpg

Facebook made: https://pbs.twimg.com/media/Byv5uWSIIAEf38C.jpg?fbclid=IwAR2...

So sure, there may be an argument that the server should ignore that param. But it's absolutely false to say it "isn't breaking anything".

2 comments

I guess this makes sense. The request contained something the server didn't understand, and wasn't expecting, so returning a 404 seems sane.

After all, as a developer, it's my site - I choose the URLs (including the query strings) which are valid and acceptable to me.

I wonder how many sites other than Twitter are rejecting requests with unknown query parameters?

Huh. That is very surprising to me, but I stand very corrected.

I would consider it to be pretty bad practice to treat query params this way, extra query params should be ignored. However, web standards are descriptive, not prescriptive. If enough sites have strict requirements about the number of query params, then it doesn't really matter what good practice is, and Facebook should accommodate this by moving back to cookies or at least make it opt-in or something.