mirror of
https://github.com/curl/curl.git
synced 2026-08-25 03:43:31 +03:00
urlapi: detect scheme better when not guessing
When the parser is not allowed to guess scheme, it should consider the word ending at the first colon to be the scheme, independently of number of slashes. The parser now checks that the scheme is known before it counts slashes, to improve the error messge for URLs with unknown schemes and maybe no slashes. When following redirects, no scheme guessing is allowed and therefore this change effectively prevents redirects to unknown schemes such as "data". Fixes #9503
This commit is contained in:
parent
7f5fe74323
commit
846678541b
4 changed files with 30 additions and 14 deletions
|
|
@ -25,7 +25,8 @@
|
|||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen);
|
||||
size_t Curl_is_absolute_url(const char *url, char *buf, size_t buflen,
|
||||
bool guess_scheme);
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue