Changeset 166 in Main for trunk/Server/server.c


Ignore:
Timestamp:
Sep 27, 2024, 5:00:49 AM (7 weeks ago)
Author:
Nishi
Message:

better redirect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/server.c

    r163 r166  
    274274        if(code == 200) {
    275275                return "200 OK";
     276        } else if(code == 301) {
     277                return "308 Moved Permanently";
    276278        } else if(code == 308) {
    277279                return "308 Permanent Redirect";
     
    603605                                                cm_log("Server", "Accessing directory without the slash at the end");
    604606                                                char* headers[3] = {"Location", cm_strcat(req.path, "/"), NULL};
    605                                                 _tw_process_page(s, sock, tw_http_status(308), NULL, NULL, NULL, 0, headers, 0, 0);
     607                                                _tw_process_page(s, sock, tw_http_status(301), NULL, NULL, NULL, 0, headers, 0, 0);
    606608                                                free(headers[1]);
    607609                                        } else {
Note: See TracChangeset for help on using the changeset viewer.