File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -340,4 +340,25 @@ mod tests {
340340 assert ! ( template. has_error( ) ) ;
341341 assert_eq ! ( template. get_status_code( ) , "200" ) ;
342342 }
343+
344+ #[ test]
345+ fn test_bif_exit_301_parse_url ( ) {
346+ let mut template = match crate :: Template :: new ( ) {
347+ Ok ( tpl) => tpl,
348+ Err ( error) => {
349+ println ! ( "Error creating Template: {}" , error) ;
350+ assert ! ( false ) ;
351+ return ;
352+ }
353+ } ;
354+ template. merge_schema_str ( SCHEMA ) . unwrap ( ) ;
355+ template. set_src_str ( "<div>{:exit; 301 >> /home?{:;__test-nts:} :}</div>" ) ;
356+ let result = template. render ( ) ;
357+ assert ! ( !template. has_error( ) ) ;
358+ assert_eq ! ( template. get_status_code( ) , "301" ) ;
359+ assert_eq ! ( template. get_status_text( ) , "Moved Permanently" ) ;
360+ assert_eq ! ( template. get_status_param( ) , "/home?nts" ) ;
361+ assert_eq ! ( result, "301 Moved Permanently\n /home?nts" ) ;
362+ }
363+
343364}
You can’t perform that action at this time.
0 commit comments