Changeset 166 in Main


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

better redirect

Files:
1 deleted
3 edited
16 copied

Legend:

Unmodified
Added
Removed
  • tags/1.08B/README

    r161 r166  
    11
    2 Tewi HTTPd version 1.08
     2Tewi HTTPd version 1.08B
    33
    44Original by Nishi <nishi@nishi.boats>
  • tags/1.08B/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 {
  • tags/1.08B/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);
  • trunk/README

    r161 r166  
    11
    2 Tewi HTTPd version 1.08
     2Tewi HTTPd version 1.08B
    33
    44Original by Nishi <nishi@nishi.boats>
  • 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.