@@ -2704,8 +2704,11 @@ deliver_redirect_map(CliSock, Req, Arg,
2704
2704
% % Here Code is 1xx, 2xx, 4xx or 5xx
2705
2705
? Debug (" in redir ~p " , [Code ]),
2706
2706
deliver_xxx (CliSock , Req , Arg , Code );
2707
- deliver_redirect_map (_CliSock , _Req , Arg ,
2708
- {_Prefix , Code , Path , Mode }, N ) when is_list (Path ) ->
2707
+ deliver_redirect_map (_CliSock , # http_request {path = {abs_path , ReqPath }}, Arg ,
2708
+ {Prefix , Code , Path , Mode }, N )
2709
+ when is_list (Path ) andalso
2710
+ % % Stop redirect loops
2711
+ ReqPath /= Prefix ->
2709
2712
% % Here Code is 1xx, 2xx, 4xx or 5xx
2710
2713
? Debug (" in redir ~p " , [Code ]),
2711
2714
Path1 = if
@@ -2725,8 +2728,13 @@ deliver_redirect_map(_CliSock, _Req, Arg,
2725
2728
put (yaws_arg , Arg ),
2726
2729
put (client_data_pos , N ),
2727
2730
{page , {[{status , Code }], Page }};
2728
- deliver_redirect_map (CliSock , Req , Arg ,
2729
- {_Prefix , Code , URL , Mode }, N ) when is_record (URL , url ) ->
2731
+ deliver_redirect_map (CliSock ,
2732
+ # http_request {path = {abs_path , ReqPath }} = Req , Arg ,
2733
+ {Prefix , Code , URL , Mode }, N )
2734
+ when is_record (URL , url )
2735
+ andalso
2736
+ % % Stop redirect loops
2737
+ ReqPath == Prefix ->
2730
2738
% % Here Code is 3xx
2731
2739
? Debug (" in redir ~p " , [Code ]),
2732
2740
H = get (outh ),
0 commit comments