@@ -269,6 +269,8 @@ PSA_JS_LIBRARY_URL_PREFIX="pagespeed_custom_static"
269
269
270
270
# An expected failure can be indicated like: "~In-place resource optimization~"
271
271
PAGESPEED_EXPECTED_FAILURES="
272
+ ~Override server header in resource flow.~
273
+ ~Override server header in IPRO flow.~
272
274
"
273
275
274
276
# Some tests are flakey under valgrind. For now, add them to the expected failures
@@ -2748,6 +2750,46 @@ start_test Base config has purging disabled. Check error message syntax.
2748
2750
OUT=$( $WGET_DUMP " $HOSTNAME /pagespeed_admin/cache?purge=*" )
2749
2751
check_from " $OUT " fgrep -q " pagespeed EnableCachePurge on;"
2750
2752
2753
+ start_test Default server header in html flow.
2754
+ URL=http://headers.example.com/mod_pagespeed_example/
2755
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2756
+ # '|| true' in the line below supresses the exit code from grep when there is no
2757
+ # match in its input (1).
2758
+ MATCHES=$( echo " $OUT " | grep -c " Server: nginx/" ) || true
2759
+ check [ $MATCHES -eq 1 ]
2760
+
2761
+ start_test Default server header in resource flow.
2762
+ URL=http://headers.example.com/mod_pagespeed_example/
2763
+ URL+=combine_javascript2.js+combine_javascript1.js.pagespeed.jc.0.js
2764
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2765
+ MATCHES=$( echo " $OUT " | grep -c " Server: nginx/" ) || true
2766
+ check [ $MATCHES -eq 1 ]
2767
+
2768
+ start_test Default server header in IPRO flow.
2769
+ URL=http://headers.example.com//mod_pagespeed_example/combine_javascript2.js
2770
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2771
+ MATCHES=$( echo " $OUT " | grep -c " Server: nginx/" ) || true
2772
+ check [ $MATCHES -eq 1 ]
2773
+
2774
+ start_test Override server header in html flow.
2775
+ URL=http://headers.example.com/mod_pagespeed_test/whitespace.html
2776
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2777
+ MATCHES=$( echo " $OUT " | grep -c " Server: override" ) || true
2778
+ check [ $MATCHES -eq 1 ]
2779
+
2780
+ start_test Override server header in resource flow.
2781
+ URL=http://headers.example.com/mod_pagespeed_test/
2782
+ URL+=A.proxy_pass.css.pagespeed.cf.0.css
2783
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2784
+ MATCHES=$( echo " $OUT " | grep -c " Server: override" ) || true
2785
+ check [ $MATCHES -eq 1 ]
2786
+
2787
+ start_test Override server header in IPRO flow.
2788
+ URL=http://headers.example.com/mod_pagespeed_test/proxy_pass.css
2789
+ OUT=$( http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1 )
2790
+ MATCHES=$( echo " $OUT " | grep -c " Server: override" ) || true
2791
+ check [ $MATCHES -eq 1 ]
2792
+
2751
2793
if $USE_VALGRIND ; then
2752
2794
# It is possible that there are still ProxyFetches outstanding
2753
2795
# at this point in time. Give them a few extra seconds to allow
0 commit comments