Klaus Demo nginx / ed42131
The "/." and "/.." at the end of URI should be normalized. Ruslan Ermilov 2 years ago
1 changed file(s) with 32 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
14361436 state = sw_quoted;
14371437 break;
14381438 case '?':
1439 u--;
14391440 r->args_start = p;
14401441 goto args;
14411442 case '#':
1443 u--;
14421444 goto done;
14431445 case '+':
14441446 r->plus_in_uri = 1;
14661468 case '\\':
14671469 #endif
14681470 case '/':
1469 state = sw_slash;
1471 case '?':
1472 case '#':
14701473 u -= 5;
14711474 for ( ;; ) {
14721475 if (u < r->uri.data) {
14781481 }
14791482 u--;
14801483 }
1484 if (ch == '?') {
1485 r->args_start = p;
1486 goto args;
1487 }
1488 if (ch == '#') {
1489 goto done;
1490 }
1491 state = sw_slash;
14811492 break;
14821493 case '%':
14831494 quoted_state = state;
14841495 state = sw_quoted;
14851496 break;
1486 case '?':
1487 r->args_start = p;
1488 goto args;
1489 case '#':
1490 goto done;
14911497 case '+':
14921498 r->plus_in_uri = 1;
14931499 /* fall through */
15621568
15631569 if (state == sw_quoted || state == sw_quoted_second) {
15641570 return NGX_HTTP_PARSE_INVALID_REQUEST;
1571 }
1572
1573 if (state == sw_dot) {
1574 u--;
1575
1576 } else if (state == sw_dot_dot) {
1577 u -= 5;
1578
1579 for ( ;; ) {
1580 if (u < r->uri.data) {
1581 return NGX_HTTP_PARSE_INVALID_REQUEST;
1582 }
1583
1584 if (*u == '/') {
1585 u++;
1586 break;
1587 }
1588
1589 u--;
1590 }
15651591 }
15661592
15671593 done: