}
send_cgi_and_exit(urlcopy, prequest, length, cookie, content_type);
}
+#endif
+
+ if (urlp[-1] == '/')
+ strcpy(urlp, index_page);
+ if (stat(tptr, &sb) == 0) {
#if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
- {
char *suffix = strrchr(tptr, '.');
if (suffix) {
Htaccess *cur;
}
}
}
- }
#endif
- if (prequest != request_GET && prequest != request_HEAD) {
- send_headers_and_exit(HTTP_NOT_IMPLEMENTED);
- }
-#endif /* FEATURE_HTTPD_CGI */
-
- if (urlp[-1] == '/')
- strcpy(urlp, index_page);
- if (stat(tptr, &sb) == 0) {
file_size = sb.st_size;
last_mod = sb.st_mtime;
}
send_cgi_and_exit("/cgi-bin/index.cgi", prequest, length, cookie, content_type);
}
}
-#endif
- /* else {
- * fall through to send_file, it errors out if open fails
- * }
- */
+ /* else fall through to send_file, it errors out if open fails: */
+ if (prequest != request_GET && prequest != request_HEAD) {
+ /* POST for files does not make sense */
+ send_headers_and_exit(HTTP_NOT_IMPLEMENTED);
+ }
send_file_and_exit(tptr,
-#if ENABLE_FEATURE_HTTPD_CGI
(prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)
+ );
#else
- SEND_HEADERS_AND_BODY
+ send_file_and_exit(tptr, SEND_HEADERS_AND_BODY);
#endif
- );
}
/*
};
const char *reject = spclchars;
int c;
- int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */
+ int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */
int breakall = flag & EXP_WORD;
int inquotes;
size_t length;