Apache: Allowing POST only when content is gzipped
Setting on Apache.
<Location /some/path>
SetInputFilter DEFLATE
#Set gzip var artificially to false
SetEnvIf SetaGzipComFalse "^" gziping=0
#If not gzip, invalidate the request
SetEnvIf "Content-Encoding" ^((?!gzip).)*$ gziping=1
#Defining only post as allowed method
SetEnvIf Request_Method "POST" posting=1
#If Gzip is enabled accept only POST otherwise doesn't accept gzip on GET method
SetEnvIf gziping 0 !posting
Order allow,deny
Allow from all
Deny from env=posting
</Location>
Written by Rafael Silva
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Apache
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#