Showing with 34 additions and 28 deletions.
  1. +8 −0 CHANGELOG.md
  2. +25 −27 files/_assets.conf.erb
  3. +1 −1 metadata.json
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [22.1.2](https://github.com/theforeman/puppet-foreman/tree/22.1.2) (2023-02-01)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/22.1.1...22.1.2)

**Fixed bugs:**

- Fixes [\#36028](https://projects.theforeman.org/issues/36028) - ensure compressed assets are returned if available [\#1106](https://github.com/theforeman/puppet-foreman/pull/1106) ([evgeni](https://github.com/evgeni))

## [22.1.1](https://github.com/theforeman/puppet-foreman/tree/22.1.1) (2023-01-26)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/22.1.0...22.1.1)
Expand Down
52 changes: 25 additions & 27 deletions files/_assets.conf.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
# Return compressed assets if they are precompiled
<IfModule mod_rewrite.c>
RewriteEngine on
# Make sure the browser supports gzip encoding and file with .gz added
# does exist on disc before we rewrite with the extension
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
RewriteCond %{REQUEST_FILENAME} \.(css|js|svg)$
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]

# Set headers for all possible assets which are compressed
<FilesMatch \.css\.gz$>
ForceType text/css
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>
<FilesMatch \.js\.gz$>
ForceType text/javascript
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>
<FilesMatch \.svg\.gz$>
ForceType image/svg+xml
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>
</IfModule>
# Set headers for all possible assets which are compressed
<FilesMatch \.css\.gz$>
ForceType text/css
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>
<FilesMatch \.js\.gz$>
ForceType text/javascript
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>
<FilesMatch \.svg\.gz$>
ForceType image/svg+xml
Header set Content-Encoding gzip
SetEnv no-gzip
</FilesMatch>

<LocationMatch "^/(assets|webpack)">
Options SymLinksIfOwnerMatch
Expand All @@ -38,4 +27,13 @@
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>

# Return compressed assets if they are precompiled
RewriteEngine On
# Make sure the browser supports gzip encoding and file with .gz added
# does exist on disc before we rewrite with the extension
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
RewriteCond %{REQUEST_FILENAME} \.(css|js|svg)$
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]
</LocationMatch>
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "22.1.1",
"version": "22.1.2",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
Expand Down