*
***************************************************************************/
#include "curl_setup.h"
+/* scheme is not URL encoded, the longest libcurl supported ones are 6
+ letters */
+#define MAX_SCHEME_LEN 8
+
bool Curl_is_absolute_url(const char *url, char *scheme, size_t buflen);
char *Curl_concat_url(const char *base, const char *relurl);
size_t Curl_strlen_url(const char *url, bool relative);
#define DEFAULT_SCHEME "https"
-/* scheme is not URL encoded, the longest libcurl supported ones are 6
- letters */
-#define MAX_SCHEME_LEN 8
-
static void free_urlhandle(struct Curl_URL *u)
{
free(u->scheme);
char endbracket;
int len;
- if((1 == sscanf(hostname, "[%*45[0123456789abcdefABCDEF:.]%c%n",
+ if((1 == sscanf(hostname, "[%*45[0123456789abcdefABCDEF:.%%]%c%n",
&endbracket, &len)) &&
(']' == endbracket)) {
/* this is a RFC2732-style specified IP-address */
if(hostname[0] == '[') {
hostname++;
- l = "0123456789abcdefABCDEF::.";
+ l = "0123456789abcdefABCDEF::.%";
hlen -= 2;
}
};
static struct testcase get_parts_list[] ={
+ {"https://[::1%252]:1234",
+ "https | [11] | [12] | [13] | [::1%252] | 1234 | / | [16] | [17]",
+ CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
{"https://127.0.0.1:443",
"https | [11] | [12] | [13] | 127.0.0.1 | [15] | / | [16] | [17]",
0, CURLU_NO_DEFAULT_PORT, CURLUE_OK},