diff --git a/src/cache/cache.c b/src/cache/cache.c index fbf0681b..fe8dd1a5 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -15,6 +15,7 @@ #include "main/main.h" #include "main/object.h" #include "network/connection.h" +#include "osdep/osdep.h" #include "protocol/protocol.h" #include "protocol/proxy.h" #include "protocol/uri.h" @@ -694,7 +695,7 @@ redirect_cache(struct cache_entry *cached, unsigned char *location, /* XXX: We are assuming here that incomplete will only be zero when * doing these fake redirects which only purpose is to add an ending * slash *cough* dirseparator to the end of the URI. */ - if (incomplete == 0 && location[0] == '/' && location[1] == 0) { + if (incomplete == 0 && dir_sep(location[0]) && location[1] == 0) { /* To be sure use get_uri_string() to get rid of post data */ uristring = get_uri_string(cached->uri, URI_ORIGINAL); if (uristring) add_to_strn(&uristring, location); diff --git a/src/protocol/file/file.c b/src/protocol/file/file.c index edbd2b76..4a79fcac 100644 --- a/src/protocol/file/file.c +++ b/src/protocol/file/file.c @@ -26,6 +26,7 @@ #include "main/module.h" #include "network/connection.h" #include "network/socket.h" +#include "osdep/osdep.h" #include "protocol/common.h" #include "protocol/file/cgi.h" #include "protocol/file/file.h" @@ -274,7 +275,7 @@ file_protocol_handler(struct connection *connection) * function properly the directory url must end with a * directory separator. */ if (name.source[0] && !dir_sep(name.source[name.length - 1])) { - redirect_location = "/"; + redirect_location = STRING_DIR_SEP; state = S_OK; } else { state = list_directory(connection, name.source, &page);