[core] r->uri.path always set, though might be ""

(might be "" if <backend>.server sets "fix-root-scriptname" => "enable")
This commit is contained in:
Glenn Strauss 2020-01-17 01:03:06 -05:00
parent 7c7f8c467c
commit c687e01c98
9 changed files with 7 additions and 10 deletions

View File

@ -2452,7 +2452,7 @@ handler_t gw_check_extension(request_st * const r, gw_plugin_data * const p, int
if (host->fix_root_path_name && extension->key.ptr[0] == '/'
&& extension->key.ptr[1] == '\0') {
buffer_copy_buffer(&r->pathinfo, &r->uri.path);
buffer_clear(&r->uri.path);
buffer_string_set_length(&r->uri.path, 0);
} else if (extension->key.ptr[0] == '/'
&& buffer_string_length(&r->uri.path)
> buffer_string_length(&extension->key)

View File

@ -128,7 +128,6 @@ static int mod_access_check (const array *allow, const array *deny, const buffer
*/
URIHANDLER_FUNC(mod_access_uri_handler) {
plugin_data *p = p_d;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
mod_access_patch_config(r, p);

View File

@ -1027,7 +1027,7 @@ URIHANDLER_FUNC(mod_dirlisting_subrequest) {
stat_cache_entry *sce = NULL;
if (NULL != r->handler_module) return HANDLER_GO_ON;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
if (buffer_string_is_empty(&r->uri.path)) return HANDLER_GO_ON;
if (r->uri.path.ptr[buffer_string_length(&r->uri.path) - 1] != '/') return HANDLER_GO_ON;
if (!http_method_get_or_head(r->http_method)) return HANDLER_GO_ON;
if (buffer_is_empty(&r->physical.path)) return HANDLER_GO_ON;

View File

@ -281,8 +281,6 @@ REQUEST_FUNC(mod_expire_handler) {
vb = http_header_response_get(r, HTTP_HEADER_CACHE_CONTROL, CONST_STR_LEN("Cache-Control"));
if (NULL != vb) return HANDLER_GO_ON;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
mod_expire_patch_config(r, p);
/* check expire.url */

View File

@ -88,7 +88,7 @@ URIHANDLER_FUNC(mod_indexfile_subrequest) {
if (NULL != r->handler_module) return HANDLER_GO_ON;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
if (buffer_string_is_empty(&r->uri.path)) return HANDLER_GO_ON;
if (r->uri.path.ptr[buffer_string_length(&r->uri.path) - 1] != '/') return HANDLER_GO_ON;
mod_indexfile_patch_config(r, p);

View File

@ -424,7 +424,9 @@ URIHANDLER_FUNC(mod_secdownload_uri_handler) {
if (NULL != r->handler_module) return HANDLER_GO_ON;
#ifdef __COVERITY__
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
#endif
mod_secdownload_patch_config(r, p);

View File

@ -358,8 +358,6 @@ URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
if (NULL != r->handler_module) return HANDLER_GO_ON;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
mod_trigger_b4_dl_patch_config(r, p);
if (!p->conf.trigger_regex || !p->conf.download_regex) return HANDLER_GO_ON;

View File

@ -222,7 +222,9 @@ static handler_t mod_userdir_docroot_construct(request_st * const r, plugin_data
URIHANDLER_FUNC(mod_userdir_docroot_handler) {
/* /~user/foo.html -> /home/user/public_html/foo.html */
#ifdef __COVERITY__
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
#endif
if (r->uri.path.ptr[0] != '/' ||
r->uri.path.ptr[1] != '~') return HANDLER_GO_ON;

View File

@ -206,8 +206,6 @@ static handler_t mod_usertrack_set_cookie(request_st * const r, plugin_data * co
URIHANDLER_FUNC(mod_usertrack_uri_handler) {
plugin_data * const p = p_d;
if (buffer_is_empty(&r->uri.path)) return HANDLER_GO_ON;
mod_usertrack_patch_config(r, p);
const buffer * const b =