parent
							
								
									4fc6bb10d7
								
							
						
					
					
						commit
						c33b05af9e
					
				|  | @ -230,7 +230,7 @@ ngx_fancyindex_conf_set_headerfooter(ngx_conf_t *cf, ngx_command_t *cmd, void *c | ||||||
| 
 | 
 | ||||||
|     /* Kind of path. Default is "subrequest". */ |     /* Kind of path. Default is "subrequest". */ | ||||||
|     ngx_uint_t kind = NGX_HTTP_FANCYINDEX_HEADERFOOTER_SUBREQUEST; |     ngx_uint_t kind = NGX_HTTP_FANCYINDEX_HEADERFOOTER_SUBREQUEST; | ||||||
|     if (cf->args->nelts == 2) { |     if (cf->args->nelts == 3) { | ||||||
|         kind = headerfooter_kind(&values[2]); |         kind = headerfooter_kind(&values[2]); | ||||||
|         if (kind == NGX_CONF_UNSET_UINT) { |         if (kind == NGX_CONF_UNSET_UINT) { | ||||||
|             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | ||||||
|  |  | ||||||
|  | @ -9,7 +9,7 @@ cat > "${TESTDIR}/footer" <<EOF | ||||||
| <div id="customfooter">yes</div> | <div id="customfooter">yes</div> | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
| nginx_start 'fancyindex_footer "/footer" local;' | nginx_start "fancyindex_footer \"${TESTDIR}/footer\" local;" | ||||||
| 
 | 
 | ||||||
| T=$(fetch / | pup -p body 'div#customfooter' text{}) | T=$(fetch / | pup -p body 'div#customfooter' text{}) | ||||||
| [[ $T == yes ]] ||  fail 'Custom header missing' | [[ $T == yes ]] ||  fail 'Custom header missing' | ||||||
|  |  | ||||||
|  | @ -9,7 +9,7 @@ cat > "${TESTDIR}/header" <<EOF | ||||||
| <div id="customheader">yes</div> | <div id="customheader">yes</div> | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
| nginx_start 'fancyindex_header "/header" local;' | nginx_start "fancyindex_header \"${TESTDIR}/header\" local;" | ||||||
| 
 | 
 | ||||||
| T=$(fetch / | pup -p body 'div#customheader' text{}) | T=$(fetch / | pup -p body 'div#customheader' text{}) | ||||||
| [[ $T == yes ]] ||  fail 'Custom header missing' | [[ $T == yes ]] ||  fail 'Custom header missing' | ||||||
|  |  | ||||||
|  | @ -12,8 +12,8 @@ cat > "${TESTDIR}/footer" <<EOF | ||||||
| <div id="customfooter">yes</div> | <div id="customfooter">yes</div> | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
| nginx_start 'fancyindex_header "/header" local; | nginx_start "fancyindex_header \"${TESTDIR}/header\" local; | ||||||
|              fancyindex_footer "/footer" local;' |              fancyindex_footer \"${TESTDIR}/footer\" local;" | ||||||
| 
 | 
 | ||||||
| P=$(fetch /) | P=$(fetch /) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,10 +14,10 @@ use pup | ||||||
| echo '<div id="topfooter">yes</div>' > "${TESTDIR}/top-footer" | echo '<div id="topfooter">yes</div>' > "${TESTDIR}/top-footer" | ||||||
| echo '<div id="subfooter">yes</div>' > "${TESTDIR}/sub-footer" | echo '<div id="subfooter">yes</div>' > "${TESTDIR}/sub-footer" | ||||||
| 
 | 
 | ||||||
| nginx_start 'fancyindex_footer "/top-footer" local; | nginx_start "fancyindex_footer \"${TESTDIR}/top-footer\" local; | ||||||
|              location /child-directory { |              location /child-directory { | ||||||
| 			    fancyindex_footer "/sub-footer" local; | 			    fancyindex_footer \"${TESTDIR}/sub-footer\" local; | ||||||
| 			 }' | 			 }" | ||||||
| 
 | 
 | ||||||
| T=$(fetch /) | T=$(fetch /) | ||||||
| echo "$T" > "$TESTDIR/top.html" | echo "$T" > "$TESTDIR/top.html" | ||||||
|  |  | ||||||
|  | @ -0,0 +1,11 @@ | ||||||
|  | #! /bin/bash | ||||||
|  | cat <<--- | ||||||
|  | This test checks that the configuration file is properly parsed if there | ||||||
|  | is only one parameter passed to the fancyndex_header and fancyindex_footer | ||||||
|  | configuration directives. | ||||||
|  | -- | ||||||
|  | 
 | ||||||
|  | nginx_start 'fancyindex_header "/header"; | ||||||
|  | 	         fancyindex_footer "/footer";' | ||||||
|  | 
 | ||||||
|  | nginx_is_running || fail 'Nginx died' | ||||||
		Loading…
	
		Reference in New Issue
	
	 Adrian Perez de Castro
						Adrian Perez de Castro