News for hackers. Stuff that matters.
Re:People like me are why you shouldn't run a hosting company by crazygringo on Friday December 22, 2023 @01:05PM (#38736781)
There's no good reason for absurdly long URL's to exist in the first place.

URL's are meant for human consumption and use -- to be copied and pasted, to fit in a message, to be typed in. They're analogous to phone numbers and addresses.

They're meant to be a pointer, a location, an index. Not a data payload. That's what POST variables are for.

No, web browsers shouldn't introduce an arbitrary limit to URL lengths. But for web hosts, it's entirely reasonable.

I mean, what, do you think filenames or filepaths should be 2 MB as well? That's absurd. But URL's are basically just the filenames of the internet.

Re:People like me are why you shouldn't run a hosting company by no_wizard on Friday December 22, 2023 @01:16PM (#38736868)
Maybe it is, maybe it isn't.

The nature of the web is changing, and has changed. Since GET requests can't have `body` data, if you have any hope of passing information along to a GET request, you must encode it in the URL in some way. This can be particularly important for things that contain unique but repeatable parameters that augment what you see on first load that would only be known by the consumer, and then can be shared by URL. For example, options set on a table you want to share with those options intact.

Re:People like me are why you shouldn't run a hosting company by crazygringo on Friday December 22, 2023 @02:15PM (#38737510)
For which something like a 4 KB limit is more than enough, like options on a table.

The point is, once you switch from options to actual data, you switch from GET to POST. This is not a bug, this is a feature. POST is for posting data. GET is for retrieving it only, not for sending it.

Re:People like me are why you shouldn't run a hosting company by no_wizard on Friday December 22, 2023 @07:19PM (#38740354)
More than enough in your opinion. It is perhaps your use case that 4KB works completely fine for, but this is not everyones.

We have a fairly complex set of options users can filter through (by design, and prior to its implementation, by high % of requests by users, FWIW) that need to be sharable on the GET request, they are definitely at least 12KB, likely more.

Re:People like me are why you shouldn't run a hosting company by crazygringo on Saturday December 23, 2023 @10:08AM (#38744723)
But that's far too large to easily share in things like plaintext emails or text messages.

If you're unable to compress it further, why don't you implement a TinyURL-type scheme? Save the options on your backend and give them a pointer to the settings. And it can expire after 30d or 1y or never.

Then it actually becomes the size of something shareable.

URLs are resource locators. You're not locating a resource, you're passing a gigantic configuration payload.

Re:People like me are why you shouldn't run a hosting company by no_wizard on Saturday December 23, 2023 @02:29PM (#38747283)
This is true, but it is the most efficient way that doesn’t induce complexity like having to serialize every option chosen to the backend immediately. Knowing we can re-create everything in first request is much more simple than other methods and doesn’t require the end user to get a special link generated for sharing they can just share straight for the URL bar.
Re:People like me are why you shouldn't run a hosting company by earthling8118 on Friday December 22, 2023 @02:22PM (#38737570)
Well there's certainly nothing that strictly prevents GETs from having a body other than no guarantee that all client libraries will handle them. I've seen a mix that allow it and disallow it. What is common is the libraries that don't support it don't seem to have any indication of this and from what I remember are likely to fail silently. Fairly annoying, so it makes sense why this is basically never used.
Re:People like me are why you shouldn't run a hosting company by teddyh on Friday December 22, 2023 @01:20PM (#38736902)
> Since GET requests aren't suppose to have `body` data, if you have any hope of passing information along to a GET request, you must encode it in the URL in some way.

Or in the request headers.

Re:People like me are why you shouldn't run a hosting company by no_wizard on Friday December 22, 2023 @01:22PM (#38736920)
To be clear, I misspoke, I should have put effectively GET requests really can't have body data. Headers have the same problem. You can't possibly encode it without encoding it in the URL anyway
Re:People like me are why you shouldn't run a hosting company by 4death4 on Friday December 22, 2023 @02:17PM (#38737518)
Why have parameters at all if they're not meant to be used? I don't really buy the argument that you're allowed to use parameters for small things but not for large things. Personally, I prefer if sites give me a local-only option of storing my data and sharing it with others.
Re:People like me are why you shouldn't run a hosting company by tgv on Friday December 22, 2023 @01:10PM (#38736814)
OTOH, they both are part of the message, the url having a more wasteful encoding. So it wouldn't matter that much, unless Vercel has a reason to store the URL in memory?
Re:People like me are why you shouldn't run a hosting company by crazygringo on Friday December 22, 2023 @01:11PM (#38736830)
No, because the URL is not the message, it's the address. Per the acronym, it's the locator only. It's not for data.

URL's get stored in logs, analytics, and so forth, where they're expected to be short.

Payloads don't. So you put the payload part in the payload, not the address.

Re:People like me are why you shouldn't run a hosting company by jorvi on Friday December 22, 2023 @01:36PM (#38737042)
URL processing is the `/bin/sh` of browsers. You can stuff anything in there, even JavaScript, and it’ll mostly work across browsers long as you adhere to the syntax.

Should it be? Probably not, but it’s a nice-to-have if you need to do something quick and dirty.