Commit 9d01dfdc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

httpd: full URL is also valid for HTTP (fixes #2320)

Also skip URI authority properly.
(cherry picked from commit a40078c8)
parent 2ebf6498
...@@ -1745,12 +1745,16 @@ static void httpd_ClientRecv( httpd_client_t *cl ) ...@@ -1745,12 +1745,16 @@ static void httpd_ClientRecv( httpd_client_t *cl )
{ {
*p2++ = '\0'; *p2++ = '\0';
} }
if( !strncasecmp( p, "rtsp:", 5 ) ) if( !strncasecmp( p, ( cl->query.i_proto
{ == HTTPD_PROTO_HTTP ) ? "http" : "rtsp", 4 )
/* for rtsp url, you have rtsp://localhost:port/path */ && p[4 + !!strchr( "sS", p[4] )] == ':' )
p += 5; { /* Skip hier-part of URL (if present) */
while( *p == '/' ) p++; p = strchr( p, ':' ) + 1; /* skip URI scheme */
while( *p && *p != '/' ) p++; if( !strncmp( p, "//", 2 ) ) /* skip authority */
{ /* see RFC3986 §3.2 */
p += 2;
while( *p && !strchr( "/?#", *p ) ) p++;
}
} }
cl->query.psz_url = strdup( p ); cl->query.psz_url = strdup( p );
if( ( p3 = strchr( cl->query.psz_url, '?' ) ) ) if( ( p3 = strchr( cl->query.psz_url, '?' ) ) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment