News for hackers. Stuff that matters.
Re:I’ve banned query strings by gpvos on Saturday May 09, 2026 @05:21PM (#48078379)
Query strings existed before CGI did, and the way they're defined to be filled in from web forms is quite useful; I wouldn't want to need Javascript to fit that into path format. There's nothing wrong about having things decided by the server; I don't get that part of your argument at all.
Re:I’ve banned query strings by cobbzilla on Saturday May 09, 2026 @05:46PM (#48078580)
Maybe dumb question: how does the server “decide” anything other than what file to serve? Today we have many choices but back in the day CGI was the first standard way to do it.

So yes query parameters existed before CGI but to use them you had to hack your server to do something with them (iirc NCSA web servers had some magic hacks for queries). CGI drove standardization.

Re:I’ve banned query strings by stirfish on Saturday May 09, 2026 @05:54PM (#48078636)

    func specialHandler(w http.ResponseWriter, r *http.Request) {
 if time.Now().Weekday() == time.Tuesday {
  http.NotFound(w, r)
  return
 }

     fmt.Fprintln(w, "server made a decision")
    }
Your server can make decisions however you program it to, you know? It's just software.

Forgive the phone-posting.

Re:I’ve banned query strings by stirfish on Saturday May 09, 2026 @08:06PM (#48079598)
I'm too slow to edit, but I wanted to be more concrete, because it's not a dumb question: I doubt there's a file somewhere that represents this comment thread, and the server had to make a decision about whether I'm logged in or not. So we know that this server is making some decisions other than which file to serve.

Again, you asked a good question in good faith. I like that.

Re:I’ve banned query strings by cobbzilla on Saturday May 09, 2026 @08:41PM (#48079822)
and what server software is running this code in 1995?
Re:I’ve banned query strings by lispwitch on Saturday May 09, 2026 @09:54PM (#48080227)
CL-HTTP or AOLserver
Re:I’ve banned query strings by cobbzilla on Saturday May 09, 2026 @10:14PM (#48080360)
sure looks like VB there, what’s the plugin? Didn’t see anything like that before.
Re:I’ve banned query strings by heavensteeth on Sunday May 10, 2026 @03:21AM (#48081752)
That's Go.
Re:I’ve banned query strings by cobbzilla on Sunday May 10, 2026 @06:07AM (#48082547)
Which runs on what computer in 1995?
Re:I’ve banned query strings by stirfish on Sunday May 10, 2026 @09:48AM (#48083959)
I'm not sure what point you're trying to make. Here it is in C, so you can run it on you computer in 1995? Because servers could make decisions in 1995.

int main() { int s = socket(AF_INET, SOCK_STREAM, 0); setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int));

    struct sockaddr_in addr = { AF_INET, htons(8080), .sin_addr.s_addr = INADDR_ANY };
    bind(s, (struct sockaddr*)&addr, sizeof(addr));
    listen(s, 10);
    printf("Listening on :8080\n");

    while (1) {
        int c = accept(s, NULL, NULL);

        char req[1024] = {0};
        read(c, req, sizeof(req) - 1);

        time_t now = time(NULL);
        int tuesday = localtime(&now)->tm_wday == 2;

        const char *status = tuesday ? "404 Not Found" : "200 OK";
        const char *body   = tuesday ? "Not Found (it's Tuesday)" : "Hello from 1995!";

        char resp[256];
        snprintf(resp, sizeof(resp),
            "HTTP/1.1 %s\r\n"
            "Content-Length: %zu\r\n"
            "Connection: close\r\n\r\n%s",
            status, strlen(body), body);

        write(c, resp, strlen(resp));
        close(c);
    }
}
Re:I’ve banned query strings by cobbzilla on Sunday May 10, 2026 @12:52PM (#48085543)
A post claimed CGI led to bad standards around query parameter formatting and parsing. I was merely pointing out that, prior to the advent of CGI, if you wanted to actually do anything with those parameters on the server, you had to extend whatever primitive HTTP server you were running, write some custom code and invent your own “standard”. There were no server side frameworks or standards.
Re:I’ve banned query strings by losvedir on Sunday May 10, 2026 @08:13AM (#48083340)
TCP has been around a long time. Listen, read, send, you're good to go. It's just software so you can make it do anything.

But you're asking about the relationship between popular primarily file serving servers like Apache and their relationship to high level code to create custom responses? Yeah, CGI was the first big standard there that I remember, though it was a bit before my time. But that's only one possible architecture.

These days, most web apps have the web server built in, and so the custom code you're writing works with the full request directly. There may be a lightweight web server in front (or multiple), like nginx, to manage connections, but they will largely just proxy the whole thing through.

Re:I’ve banned query strings by cobbzilla on Monday May 11, 2026 @02:04AM (#48091516)
I was responding to:

> Query strings existed before CGI did… There's nothing wrong about having things decided by the server

Sure, but there is also no standard for how to format/parse the query string. And also no server plugin frameworks. So you are inventing your own standard and extending some HTTP server for which you have source. Until CGI forces a standard, bad as it might be; it’s a common ground.