commit - e05fe5fe7eb21226fe1262f60043bd44ce1827ec
commit + 46250b465f87ef092e595f687eec6e2095bef8d7
blob - /dev/null
blob + 54fa38235e37f2f418e9bfa833befbdb60d3e68f (mode 644)
--- /dev/null
+++ changelogs/unreleased/gh-9556-fix-uri-ipv6.md
+## bugfix/lua/uri
+
+* Fixed a bug that caused characters A-F to be unsupported in IPv6
+ addresses (gh-9556).
blob - acb7c01ef470fa938e22a0489618888e6d2a59e3
blob + 50680787fb6a17f8fc4541ea3dbdfdd1fa610d1b
--- src/lib/uri/uri_parser.c
+++ src/lib/uri/uri_parser.c
case 53:
if ( (*p) == 58 )
goto tr61;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto tr60;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto tr60;
- } else if ( (*p) >= 48 )
+ } else
goto tr60;
goto st0;
tr60:
if ( ++p == pe )
goto _test_eof54;
case 54:
-#line 2196 "src/lib/uri/uri_parser.c"
+#line 2199 "src/lib/uri/uri_parser.c"
if ( (*p) == 58 )
goto st58;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st55;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st55;
- } else if ( (*p) >= 48 )
+ } else
goto st55;
goto st0;
st55:
case 55:
if ( (*p) == 58 )
goto st58;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st56;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st56;
- } else if ( (*p) >= 48 )
+ } else
goto st56;
goto st0;
st56:
case 56:
if ( (*p) == 58 )
goto st58;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st57;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st57;
- } else if ( (*p) >= 48 )
+ } else
goto st57;
goto st0;
st57:
case 58: goto st63;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st59;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st59;
- } else if ( (*p) >= 48 )
+ } else
goto st59;
goto st0;
st59:
case 58: goto st63;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st60;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st60;
- } else if ( (*p) >= 48 )
+ } else
goto st60;
goto st0;
st60:
case 58: goto st63;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st61;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st61;
- } else if ( (*p) >= 48 )
+ } else
goto st61;
goto st0;
st61:
case 58: goto st63;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st62;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st62;
- } else if ( (*p) >= 48 )
+ } else
goto st62;
goto st0;
st62:
case 58: goto st68;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st64;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st64;
- } else if ( (*p) >= 48 )
+ } else
goto st64;
goto st0;
st64:
case 58: goto st68;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st65;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st65;
- } else if ( (*p) >= 48 )
+ } else
goto st65;
goto st0;
st65:
case 58: goto st68;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st66;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st66;
- } else if ( (*p) >= 48 )
+ } else
goto st66;
goto st0;
st66:
case 58: goto st68;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st67;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st67;
- } else if ( (*p) >= 48 )
+ } else
goto st67;
goto st0;
st67:
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st69;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st69;
- } else if ( (*p) >= 48 )
+ } else
goto st69;
goto st0;
st69:
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st70;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st70;
- } else if ( (*p) >= 48 )
+ } else
goto st70;
goto st0;
st70:
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st71;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st71;
- } else if ( (*p) >= 48 )
+ } else
goto st71;
goto st0;
st71:
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st72;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st72;
- } else if ( (*p) >= 48 )
+ } else
goto st72;
goto st0;
st72:
case 58: goto st78;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st74;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st74;
- } else if ( (*p) >= 48 )
+ } else
goto st74;
goto st0;
st74:
case 58: goto st78;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st75;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st75;
- } else if ( (*p) >= 48 )
+ } else
goto st75;
goto st0;
st75:
case 58: goto st78;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st76;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st76;
- } else if ( (*p) >= 48 )
+ } else
goto st76;
goto st0;
st76:
case 58: goto st78;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st77;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st77;
- } else if ( (*p) >= 48 )
+ } else
goto st77;
goto st0;
st77:
case 58: goto st83;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st79;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st79;
- } else if ( (*p) >= 48 )
+ } else
goto st79;
goto st0;
st79:
case 58: goto st83;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st80;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st80;
- } else if ( (*p) >= 48 )
+ } else
goto st80;
goto st0;
st80:
case 58: goto st83;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st81;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st81;
- } else if ( (*p) >= 48 )
+ } else
goto st81;
goto st0;
st81:
case 58: goto st83;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st82;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st82;
- } else if ( (*p) >= 48 )
+ } else
goto st82;
goto st0;
st82:
case 58: goto st88;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st84;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st84;
- } else if ( (*p) >= 48 )
+ } else
goto st84;
goto st0;
st84:
case 58: goto st88;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st85;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st85;
- } else if ( (*p) >= 48 )
+ } else
goto st85;
goto st0;
st85:
case 58: goto st88;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st86;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st86;
- } else if ( (*p) >= 48 )
+ } else
goto st86;
goto st0;
st86:
case 58: goto st88;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st87;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st87;
- } else if ( (*p) >= 48 )
+ } else
goto st87;
goto st0;
st87:
case 58: goto st93;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st89;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st89;
- } else if ( (*p) >= 48 )
+ } else
goto st89;
goto st0;
st89:
case 58: goto st93;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st90;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st90;
- } else if ( (*p) >= 48 )
+ } else
goto st90;
goto st0;
st90:
case 58: goto st93;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st91;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st91;
- } else if ( (*p) >= 48 )
+ } else
goto st91;
goto st0;
st91:
case 58: goto st93;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st92;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st92;
- } else if ( (*p) >= 48 )
+ } else
goto st92;
goto st0;
st92:
case 93:
if ( (*p) == 93 )
goto tr68;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st94;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st94;
- } else if ( (*p) >= 48 )
+ } else
goto st94;
goto st0;
st94:
case 94:
if ( (*p) == 93 )
goto tr68;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st95;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st95;
- } else if ( (*p) >= 48 )
+ } else
goto st95;
goto st0;
st95:
case 95:
if ( (*p) == 93 )
goto tr68;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st96;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st96;
- } else if ( (*p) >= 48 )
+ } else
goto st96;
goto st0;
st96:
case 96:
if ( (*p) == 93 )
goto tr68;
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st97;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st97;
- } else if ( (*p) >= 48 )
+ } else
goto st97;
goto st0;
st97:
if ( ++p == pe )
goto _test_eof186;
case 186:
-#line 2755 "src/lib/uri/uri_parser.c"
+#line 2863 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 35: goto tr202;
case 47: goto tr203;
if ( ++p == pe )
goto _test_eof98;
case 98:
-#line 2771 "src/lib/uri/uri_parser.c"
+#line 2879 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 58: goto st99;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st59;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st59;
- } else if ( (*p) >= 48 )
+ } else
goto st59;
goto st0;
st99:
case 99:
switch( (*p) ) {
case 58: goto st68;
+ case 70: goto st100;
case 93: goto tr68;
case 102: goto st100;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st64;
+ } else if ( (*p) > 69 ) {
if ( 97 <= (*p) && (*p) <= 101 )
goto st64;
- } else if ( (*p) >= 48 )
+ } else
goto st64;
goto st0;
st100:
case 100:
switch( (*p) ) {
case 58: goto st68;
+ case 70: goto st101;
case 93: goto tr68;
case 102: goto st101;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st65;
+ } else if ( (*p) > 69 ) {
if ( 97 <= (*p) && (*p) <= 101 )
goto st65;
- } else if ( (*p) >= 48 )
+ } else
goto st65;
goto st0;
st101:
case 101:
switch( (*p) ) {
case 58: goto st68;
+ case 70: goto st102;
case 93: goto tr68;
case 102: goto st102;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st66;
+ } else if ( (*p) > 69 ) {
if ( 97 <= (*p) && (*p) <= 101 )
goto st66;
- } else if ( (*p) >= 48 )
+ } else
goto st66;
goto st0;
st102:
case 102:
switch( (*p) ) {
case 58: goto st68;
+ case 70: goto st103;
case 93: goto tr68;
case 102: goto st103;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st67;
+ } else if ( (*p) > 69 ) {
if ( 97 <= (*p) && (*p) <= 101 )
goto st67;
- } else if ( (*p) >= 48 )
+ } else
goto st67;
goto st0;
st103:
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st105;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st69;
- } else if ( (*p) >= 48 )
- goto st105;
+ } else
+ goto st69;
goto st0;
st105:
if ( ++p == pe )
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st117;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st70;
- } else if ( (*p) >= 48 )
- goto st117;
+ } else
+ goto st70;
goto st0;
st106:
if ( ++p == pe )
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st118;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st71;
- } else if ( (*p) >= 48 )
- goto st118;
+ } else
+ goto st71;
goto st0;
st118:
if ( ++p == pe )
case 58: goto st73;
case 93: goto tr68;
}
- if ( (*p) > 57 ) {
+ if ( (*p) < 65 ) {
+ if ( 48 <= (*p) && (*p) <= 57 )
+ goto st72;
+ } else if ( (*p) > 70 ) {
if ( 97 <= (*p) && (*p) <= 102 )
goto st72;
- } else if ( (*p) >= 48 )
+ } else
goto st72;
goto st0;
tr34:
if ( ++p == pe )
goto _test_eof187;
case 187:
-#line 3007 "src/lib/uri/uri_parser.c"
+#line 3146 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st157;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof191;
case 191:
-#line 3113 "src/lib/uri/uri_parser.c"
+#line 3252 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof193;
case 193:
-#line 3167 "src/lib/uri/uri_parser.c"
+#line 3306 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof194;
case 194:
-#line 3196 "src/lib/uri/uri_parser.c"
+#line 3335 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st195;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof196;
case 196:
-#line 3322 "src/lib/uri/uri_parser.c"
+#line 3461 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st21;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof197;
case 197:
-#line 3357 "src/lib/uri/uri_parser.c"
+#line 3496 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st21;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof198;
case 198:
-#line 3391 "src/lib/uri/uri_parser.c"
+#line 3530 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st150;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof199;
case 199:
-#line 3427 "src/lib/uri/uri_parser.c"
+#line 3566 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st200;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof201;
case 201:
-#line 3553 "src/lib/uri/uri_parser.c"
+#line 3692 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st202;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof204;
case 204:
-#line 3718 "src/lib/uri/uri_parser.c"
+#line 3857 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st170;
case 35: goto tr202;
if ( ++p == pe )
goto _test_eof205;
case 205:
-#line 3753 "src/lib/uri/uri_parser.c"
+#line 3892 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st150;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof222;
case 222:
-#line 4233 "src/lib/uri/uri_parser.c"
+#line 4372 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st150;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof223;
case 223:
-#line 4272 "src/lib/uri/uri_parser.c"
+#line 4411 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto tr181;
case 35: goto tr182;
if ( ++p == pe )
goto _test_eof224;
case 224:
-#line 4311 "src/lib/uri/uri_parser.c"
+#line 4450 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof226;
case 226:
-#line 4375 "src/lib/uri/uri_parser.c"
+#line 4514 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st226;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof134;
case 134:
-#line 4408 "src/lib/uri/uri_parser.c"
+#line 4547 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 37: goto st226;
case 117: goto st135;
if ( ++p == pe )
goto _test_eof227;
case 227:
-#line 4493 "src/lib/uri/uri_parser.c"
+#line 4632 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto tr280;
case 35: goto tr182;
if ( ++p == pe )
goto _test_eof228;
case 228:
-#line 4528 "src/lib/uri/uri_parser.c"
+#line 4667 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st228;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof139;
case 139:
-#line 4559 "src/lib/uri/uri_parser.c"
+#line 4698 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 37: goto st228;
case 117: goto st140;
if ( ++p == pe )
goto _test_eof229;
case 229:
-#line 4649 "src/lib/uri/uri_parser.c"
+#line 4788 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto tr287;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof230;
case 230:
-#line 4687 "src/lib/uri/uri_parser.c"
+#line 4826 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st230;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof144;
case 144:
-#line 4718 "src/lib/uri/uri_parser.c"
+#line 4857 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 37: goto st230;
case 117: goto st145;
if ( ++p == pe )
goto _test_eof231;
case 231:
-#line 4799 "src/lib/uri/uri_parser.c"
+#line 4938 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr182;
if ( ++p == pe )
goto _test_eof232;
case 232:
-#line 4835 "src/lib/uri/uri_parser.c"
+#line 4974 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof233;
case 233:
-#line 4870 "src/lib/uri/uri_parser.c"
+#line 5009 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof234;
case 234:
-#line 4902 "src/lib/uri/uri_parser.c"
+#line 5041 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st230;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof235;
case 235:
-#line 4935 "src/lib/uri/uri_parser.c"
+#line 5074 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st230;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof250;
case 250:
-#line 5383 "src/lib/uri/uri_parser.c"
+#line 5522 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st230;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof254;
case 254:
-#line 5497 "src/lib/uri/uri_parser.c"
+#line 5636 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st228;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof255;
case 255:
-#line 5534 "src/lib/uri/uri_parser.c"
+#line 5673 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st228;
case 35: goto tr193;
if ( ++p == pe )
goto _test_eof256;
case 256:
-#line 5569 "src/lib/uri/uri_parser.c"
+#line 5708 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st226;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof257;
case 257:
-#line 5604 "src/lib/uri/uri_parser.c"
+#line 5743 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st226;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof272;
case 272:
-#line 6054 "src/lib/uri/uri_parser.c"
+#line 6193 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st226;
case 35: goto tr166;
if ( ++p == pe )
goto _test_eof276;
case 276:
-#line 6168 "src/lib/uri/uri_parser.c"
+#line 6307 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof278;
case 278:
-#line 6222 "src/lib/uri/uri_parser.c"
+#line 6361 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st153;
case 35: goto tr157;
if ( ++p == pe )
goto _test_eof279;
case 279:
-#line 6255 "src/lib/uri/uri_parser.c"
+#line 6394 "src/lib/uri/uri_parser.c"
switch( (*p) ) {
case 33: goto st150;
case 35: goto tr166;
#line 176 "src/lib/uri/uri_parser.rl"
{ uri->path = s; uri->path_len = p - s; }
break;
-#line 6941 "src/lib/uri/uri_parser.c"
+#line 7080 "src/lib/uri/uri_parser.c"
}
}
blob - 0f5f95635db4e195938f4bc9b201f2072900b830
blob + 42dd861180dfcb16b7884d27b252de8cfce4bceb
--- src/lib/uri/uri_parser.rl
+++ src/lib/uri/uri_parser.rl
>{ s = p; }
%{ uri->host = s; uri->host_len = p - s;};
- hex1_4 = ([0-9a-fa-f]{1,4});
+ hex1_4 = ([0-9a-fA-F]{1,4});
ip4addr = ((digit{1,3}) (("." digit{1,3}){3}));
ip4 = ip4addr
ip6 = ("[" (
((hex1_4?) ((":" (hex1_4?)){1,8})) |
- ("::" [ff][ff][ff][ff] ":" ip4addr))
+ ("::" [fF][fF][fF][fF] ":" ip4addr))
>{ s = p; }
%{ uri->host = s; uri->host_len = p - s;
uri->host_hint = 2; }
blob - /dev/null
blob + 7082f2fe67bb75b087e3d234b2b48c6f4f15f6a3 (mode 644)
--- /dev/null
+++ test/app-luatest/gh_9556_uri_parse_format_ipv6_test.lua
+local t = require('luatest')
+local uri = require('uri')
+
+-- IPv6 addresses from RFC 2732 corresponding to IPv6 addresses
+-- processed by uri (refer to src/lib/uri/uri_parser.rl:114).
+local addrs = {
+ '[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]',
+ '[1080:0:0:0:8:800:200C:4171]',
+ '[3ffe:2a00:100:7031::1]',
+ '[1080::8:800:200C:417A]',
+ '[::FFFF:129.144.52.38]',
+ '[2010:836b:4179::836b:4179]'
+}
+
+local g1 = t.group('group_parse_ipv6', t.helpers.matrix({
+ schema = {nil, 'http'},
+ service = {nil, 80},
+ path = {nil, 'foo', 'index.html'},
+ u = addrs,
+}))
+
+local function join_url(params)
+ local url = ''
+ if params.schema ~= nil then
+ url = params.schema .. '://'
+ end
+ url = url .. params.u
+ if params.service ~= nil then
+ url = url .. ':' .. params.service
+ end
+ if params.path ~= nil then
+ url = url .. '/' .. params.path
+ end
+ return url
+end
+
+g1.test_parse_urls_with_ipv6_addresses = function(cg)
+ -- This test verifies the correct handling and parsing of URIs containing
+ -- IPv6 addresses as specified in RFC 2732.
+ local url = join_url(cg.params)
+ local res = uri.parse(url)
+ t.assert_not_equals(res, nil, string.format('Error while parsing %q', url))
+ t.assert_equals(type(res), 'table',
+ string.format('uri.parse(%q) is not a table', url))
+ local expected = {
+ schema = cg.params.schema,
+ host = cg.params.u,
+ service = cg.params.service,
+ path = cg.params.path,
+ ipv6 = cg.params.u,
+ }
+ for key, value in ipairs(expected) do
+ local msg = string.format('Mismatch field %q: expected %q, got %q',
+ key, tostring(res[key]), tostring(value))
+ t.assert_equals(value, res[key], msg)
+ end
+end