httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1791008 - in /httpd/test/mod_h2/trunk: ./ conf/ conf/sites/ htdocs/test.example.org/apache.org-files/ test/go/
Date Tue, 11 Apr 2017 18:26:55 GMT
Author: icing
Date: Tue Apr 11 18:26:55 2017
New Revision: 1791008

URL: http://svn.apache.org/viewvc?rev=1791008&view=rev
Log:
adding tests for invalid inc headers, added brotli config

Added:
    httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/async-ads.js.br   (with
props)
    httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/min.css.br   (with props)
    httpd/test/mod_h2/trunk/test/go/in-headers-inv.fuzz
Modified:
    httpd/test/mod_h2/trunk/Makefile.am
    httpd/test/mod_h2/trunk/conf/httpd.conf
    httpd/test/mod_h2/trunk/conf/modules.conf
    httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
    httpd/test/mod_h2/trunk/test/go/h2fuzz.go
    httpd/test/mod_h2/trunk/test/go/in-footer.fuzz
    httpd/test/mod_h2/trunk/test/go/in-rst.fuzz
    httpd/test/mod_h2/trunk/test/go/test_fuzz.sh
    httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz

Modified: httpd/test/mod_h2/trunk/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/Makefile.am?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/Makefile.am Tue Apr 11 18:26:55 2017
@@ -324,18 +324,14 @@ $(SERVER_DIR)/.testdocs-setup: \
 	@touch $(SERVER_DIR)/.testdocs-setup
 
 $(SERVER_DIR)/.test-setup: \
-        Makefile \
-		$(SERVER_DIR)/.curl-installed \
-		mh2fuzz/mmh2fuzz \
-		conf/*.conf \
-        bin/* \
-        conf/mods-available/*.* \
-		conf/sites/*.conf \
-		$(SERVER_DIR)/conf/ssl/test.example.org.key \
-		$(SERVER_DIR)/conf/ssl/test.example.org.pem \
-		$(SERVER_DIR)/conf/ssl/noh2.example.org.key \
-		$(SERVER_DIR)/conf/ssl/noh2.example.org.pem \
-		$(SERVER_DIR)/.testdocs-setup
+        Makefile $(SERVER_DIR)/.curl-installed mh2fuzz/mh2fuzz \
+	conf/*.conf conf/sites/*.conf bin/* \
+        conf/mods-available/*.* conf/sites/*.conf \
+        $(SERVER_DIR)/conf/ssl/test.example.org.key \
+	$(SERVER_DIR)/conf/ssl/test.example.org.pem \
+	$(SERVER_DIR)/conf/ssl/noh2.example.org.key \
+	$(SERVER_DIR)/conf/ssl/noh2.example.org.pem \
+	$(SERVER_DIR)/.testdocs-setup
 	@echo -n setup httpd locally...
 	@mkdir -p $(SERVER_DIR)/bin
 	@mkdir -p $(SERVER_DIR)/cache

Modified: httpd/test/mod_h2/trunk/conf/httpd.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/httpd.conf?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/httpd.conf (original)
+++ httpd/test/mod_h2/trunk/conf/httpd.conf Tue Apr 11 18:26:55 2017
@@ -193,6 +193,39 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
     Protocols h2c http/1.1
 </VirtualHost>
 
+################################################################################
+# brotli
+################################################################################
+<IfModule brotli_module>
+    <IfModule mod_headers.c>
+        # Serve brotli compressed CSS files if they exist
+        # and the client accepts brotli.
+        RewriteCond "%{HTTP:Accept-encoding}" "br"
+        RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
+        RewriteRule "^(.*)\.css"              "$1\.css\.br" [QSA]
+
+        # Serve brotli compressed JS files if they exist
+        # and the client accepts brotli.
+        RewriteCond "%{HTTP:Accept-encoding}" "br"
+        RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
+        RewriteRule "^(.*)\.js"               "$1\.js\.br" [QSA]
+
+
+        # Serve correct content types, and prevent double compression.
+        RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1]
+        RewriteRule "\.js\.br$"  "-" [T=text/javascript,E=no-brotli:1]
+
+
+        <FilesMatch "(\.js\.br|\.css\.br)$">
+          # Serve correct encoding type.
+          Header append Content-Encoding br
+
+          # Force proxies to cache brotli &amp;
+          # non-brotli css/js files separately.
+          Header append Vary Accept-Encoding
+        </FilesMatch>
+    </IfModule>
+</IfModule>
 
 IncludeOptional conf/sites/*.conf
 

Modified: httpd/test/mod_h2/trunk/conf/modules.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/modules.conf?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/modules.conf (original)
+++ httpd/test/mod_h2/trunk/conf/modules.conf Tue Apr 11 18:26:55 2017
@@ -97,6 +97,8 @@ LoadModule dir_module modules/mod_dir.so
 LoadModule alias_module modules/mod_alias.so
 LoadModule rewrite_module modules/mod_rewrite.so
 
+#LoadModule brotli_module modules/mod_brotli.so
+
 #LoadModule fcgid_module modules/mod_fcgid.so
 LoadModule http2_module modules/mod_http2.so
 <IfVersion >= 2.4.21>

Modified: httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf (original)
+++ httpd/test/mod_h2/trunk/conf/sites/test.example.org.conf Tue Apr 11 18:26:55 2017
@@ -25,6 +25,13 @@
      SSLVerifyClient require
 </Directory>
 
+<Directory "SUBST_SERVER_ROOT_SUBST/htdocs/test.example.org/apache.org-files">
+    <IfModule brotli_module>
+        SetOutputFilter BROTLI_COMPRESS
+        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-brotli
+    </IfModule>
+</Directory>
+
 <VirtualHost *:SUBST_PORT_HTTPS_SUBST>
 	ServerName test.example.org
     ServerAlias test3.example.org

Added: httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/async-ads.js.br
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/async-ads.js.br?rev=1791008&view=auto
==============================================================================
Binary file - no diff available.

Propchange: httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/async-ads.js.br
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/min.css.br
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/min.css.br?rev=1791008&view=auto
==============================================================================
Binary file - no diff available.

Propchange: httpd/test/mod_h2/trunk/htdocs/test.example.org/apache.org-files/min.css.br
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: httpd/test/mod_h2/trunk/test/go/h2fuzz.go
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/h2fuzz.go?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/h2fuzz.go (original)
+++ httpd/test/mod_h2/trunk/test/go/h2fuzz.go Tue Apr 11 18:26:55 2017
@@ -307,6 +307,8 @@ func (app *h2fuzz) readHeaders() error {
             break
         }
         line := string(bytes)
+        line = strings.Replace(line, "\\n", "\n", -1)
+        line = strings.Replace(line, "\\r", "\r", -1)
         f := strings.SplitN(line, ": ", 2)
         if len(f) != 2 {
             break
@@ -351,7 +353,7 @@ func (app *h2fuzz) cmdStreamGet(args []s
         app.streamID += 2
     }
     app.eos = flags["eos"]
-    app.eoh = flags["eoh"]
+    app.eoh = flags["end"]
     app.hcont = !app.eoh
     
     app.logf("-->[HEADER stream=%d, method=GET, path=%s, eoh=%v, eos=%v]", 
@@ -436,7 +438,7 @@ func (app *h2fuzz) cmdHeadersEmpty(args
         app.streamID += 2
     }
     app.eos = flags["eos"]
-    app.eoh = flags["eoh"]
+    app.eoh = flags["end"]
     app.hcont = false
     
     app.logf("-->[HEADER stream=%d, <empty>, eoh=%v, eos=%v]", 

Modified: httpd/test/mod_h2/trunk/test/go/in-footer.fuzz
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/in-footer.fuzz?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/in-footer.fuzz (original)
+++ httpd/test/mod_h2/trunk/test/go/in-footer.fuzz Tue Apr 11 18:26:55 2017
@@ -6,6 +6,6 @@ data
 headers-add end
 x: y
 
-wait 100ms
+wait 1ms
 goaway
 wait

Added: httpd/test/mod_h2/trunk/test/go/in-headers-inv.fuzz
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/in-headers-inv.fuzz?rev=1791008&view=auto
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/in-headers-inv.fuzz (added)
+++ httpd/test/mod_h2/trunk/test/go/in-headers-inv.fuzz Tue Apr 11 18:26:55 2017
@@ -0,0 +1,12 @@
+wait 1ms
+stream-get / end eos
+x1: y
+x2: y\nx
+
+stream-get / end eos
+x1: y
+x2: y\rx
+
+wait 1ms
+goaway
+wait

Modified: httpd/test/mod_h2/trunk/test/go/in-rst.fuzz
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/in-rst.fuzz?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/in-rst.fuzz (original)
+++ httpd/test/mod_h2/trunk/test/go/in-rst.fuzz Tue Apr 11 18:26:55 2017
@@ -1,10 +1,10 @@
 wait 1ms
 stream-get /005.txt eos
 
-headers-add end
+headers-add eoh
 x-tc-rst: 1
 
 reset
-wait 100ms
+wait 1ms
 goaway
 wait

Modified: httpd/test/mod_h2/trunk/test/go/test_fuzz.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/test_fuzz.sh?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/test_fuzz.sh (original)
+++ httpd/test/mod_h2/trunk/test/go/test_fuzz.sh Tue Apr 11 18:26:55 2017
@@ -110,8 +110,7 @@ EOF
 check_traffic "$TOP"/in-footer.fuzz "checking GET+footers" <<EOF
 <--[FrameHeader SETTINGS len=6]
 <--[FrameHeader WINDOW_UPDATE len=4]
--->[HEADER stream=1, method=GET, path=/, eoh=false, eos=false]
--->[CONTINUATION stream=1, eoh=true]
+-->[HEADER stream=1, method=GET, path=/, eoh=true, eos=false]
 -->[DATA stream=1, len=0, eos=false]
 -->[HEADER stream=1: eoh=true, eos=true]
 <--[FrameHeader HEADERS flags=END_HEADERS stream=1 len=XXX]
@@ -138,9 +137,21 @@ EOF
 check_traffic "$TOP"/in-headers-empty.fuzz "checking empty HEADERS" <<EOF
 <--[FrameHeader SETTINGS len=6]
 <--[FrameHeader WINDOW_UPDATE len=4]
--->[HEADER stream=1, <empty>, eoh=false, eos=true]
+-->[HEADER stream=1, <empty>, eoh=true, eos=true]
+<--[FrameHeader RST_STREAM stream=1 len=4]
 -->[GOAWAY
-<--[FrameHeader GOAWAY len=65]
+<--[FrameHeader GOAWAY len=8]
+EOF
+
+check_traffic "$TOP"/in-headers-inv.fuzz "checking invalid HEADERS" <<EOF
+<--[FrameHeader SETTINGS len=6]
+<--[FrameHeader WINDOW_UPDATE len=4]
+-->[HEADER stream=1, method=GET, path=/, eoh=true, eos=true]
+-->[HEADER stream=3, method=GET, path=/, eoh=true, eos=true]
+<--[FrameHeader RST_STREAM stream=1 len=4]
+<--[FrameHeader RST_STREAM stream=3 len=4]
+-->[GOAWAY
+<--[FrameHeader GOAWAY len=8]
 EOF
 
 

Modified: httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz?rev=1791008&r1=1791007&r2=1791008&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz (original)
+++ httpd/test/mod_h2/trunk/test/go/trace-trailer.fuzz Tue Apr 11 18:26:55 2017
@@ -1,5 +1,5 @@
 wait 1ms
-stream-get TRACE / end
+stream-get TRACE / eoh
 trailer: x
 content-length: 0
 
@@ -7,6 +7,6 @@ data
 headers-add end
 x: y
 
-wait 100ms
+wait 1ms
 goaway
 wait



Mime
View raw message