@@ -417,3 +417,69 @@ g.test_content_type_header_without_render = function()
417417 t .assert_equals (r .status , 200 )
418418 t .assert_equals (r .headers [' content-type' ], ' text/plain; charset=utf-8' , ' content-type header' )
419419end
420+
421+ g .test_trailing_slash_f_get = function ()
422+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/c' )
423+ t .assert_equals (r .status , 200 )
424+ t .assert_equals (r .body , ' c' )
425+ end
426+
427+ g .test_trailing_slash_f_get_with_slash_at_begging = function ()
428+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b//c' )
429+ t .assert_equals (r .status , 200 )
430+ t .assert_equals (r .body , ' /c' )
431+ end
432+
433+ g .test_trailing_slash_f_get_with_slash_at_begging_and_end = function ()
434+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b//c/' )
435+ t .assert_equals (r .status , 200 )
436+ t .assert_equals (r .body , ' /c/' )
437+ end
438+
439+ g .test_trailing_slash_f_get_with_slash = function ()
440+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/c/' )
441+ t .assert_equals (r .status , 200 )
442+ t .assert_equals (r .body , ' c/' )
443+ end
444+
445+ g .test_trailing_slash_f_get_with_encoded_slash_begging = function ()
446+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/%2Fc' )
447+ t .assert_equals (r .status , 200 )
448+ t .assert_equals (r .body , ' /c' )
449+ end
450+
451+ g .test_trailing_slash_f_get_with_encoded_slash_begging_and_end = function ()
452+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/%2Fc%2F' )
453+ t .assert_equals (r .status , 200 )
454+ t .assert_equals (r .body , ' /c/' )
455+ end
456+
457+ g .test_trailing_slash_f_get_html = function ()
458+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/c.htm' )
459+ t .assert_equals (r .status , 200 )
460+ t .assert_equals (r .body , ' c.htm' )
461+ end
462+
463+ g .test_trailing_slash_f_get_long = function ()
464+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/c/d/e' )
465+ t .assert_equals (r .status , 200 )
466+ t .assert_equals (r .body , ' c/d/e' )
467+ end
468+
469+ g .test_trailing_slash_f_get_long_with_slash_end = function ()
470+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_f/a/b/c/d/e/' )
471+ t .assert_equals (r .status , 200 )
472+ t .assert_equals (r .body , ' c/d/e/' )
473+ end
474+
475+ g .test_trailing_slash_t_get_with_slash_at_begging_and_end = function ()
476+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_t/a/b//c/' )
477+ t .assert_equals (r .status , 200 )
478+ t .assert_equals (r .body , ' /c' )
479+ end
480+
481+ g .test_trailing_slash_t_get_with_encoded_slash_begging_and_end = function ()
482+ local r = http_client .get (helpers .base_uri .. ' /trailing_slash_t/a/b/%2Fc%2F' )
483+ t .assert_equals (r .status , 200 )
484+ t .assert_equals (r .body , ' /c' )
485+ end
0 commit comments