Changeset 166 in Main for trunk/Server


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

better redirect

Location:
trunk/Server
Files:
2 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 {
  • trunk/Server/tw_version.h

    r163 r166  
    88#endif
    99
    10 #define TW_VERSION "1.08A\0"
     10#define TW_VERSION "1.08B\0"
    1111
    1212const char* tw_get_version(void);
Note: See TracChangeset for help on using the changeset viewer.