Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Copy Accept-Encoding normalisation from EC2 Varnish
Browse files Browse the repository at this point in the history
  • Loading branch information
samsimpson1 committed May 19, 2022
1 parent 9d27cd7 commit a3e7619
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/test-outputs/www-eks-integration.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
2 changes: 2 additions & 0 deletions spec/test-outputs/www-eks-production.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ sub vcl_recv {





# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions spec/test-outputs/www-eks-staging.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions spec/test-outputs/www-eks-test.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions spec/test-outputs/www-integration.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
2 changes: 2 additions & 0 deletions spec/test-outputs/www-production.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ sub vcl_recv {





# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions spec/test-outputs/www-staging.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions spec/test-outputs/www-test.out.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ sub vcl_recv {




# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}


# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down
9 changes: 9 additions & 0 deletions vcl_templates/www.vcl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ sub vcl_recv {
}
<% end %>

<% if environment != 'production' %>
# Strip Accept-Encoding header if the content is already compressed
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|zip|flv|pdf|mp3|ogg)$") {
remove req.http.Accept-Encoding;
}
}
<% end %>

# Force SSL.
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
Expand Down

0 comments on commit a3e7619

Please sign in to comment.