Skip to content

Commit

Permalink
Add configs for cursor images (.cur)
Browse files Browse the repository at this point in the history
Apply all the configs used for `.ico` files to `.cur` files as the two
image formats are almost identical.

The MIME type for the `.cur` file doesn't matter as browsers seem to
sniff the content. However, `image/x-icon` is specified because it's
the one usually used for `.ico` file and because it's shorther then the
other frequentlly used one (`image/vnd.microsoft.icon`), making the
header size smaller.

See also:
* http://en.wikipedia.org/wiki/ICO_%28file_format%29
* http://msdn.microsoft.com/en-us/library/windows/desktop/ms648007%28v=vs.85%29.aspx

Ref: h5bp/server-configs-nginx#5.
  • Loading branch information
alrra committed Oct 4, 2013
1 parent 8057f17 commit a795fff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(gif|ico|jpe?g|png|svgz?|webp)$">
<FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
Expand Down Expand Up @@ -92,7 +92,7 @@ Options -MultiViews
Header set X-UA-Compatible "IE=edge"
# `mod_headers` can't match based on the content-type, however, we only
# want to send this header for HTML pages and not for the other resources
<FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
<FilesMatch "\.(appcache|crx|css|cur|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>
Expand Down Expand Up @@ -159,6 +159,7 @@ Options -MultiViews
AddType application/x-xpinstall xpi
AddType application/xml atom rdf rss xml
AddType image/webp webp
AddType image/x-icon cur
AddType text/cache-manifest appcache manifest
AddType text/vtt vtt
AddType text/x-component htc
Expand Down Expand Up @@ -270,7 +271,7 @@ AddDefaultCharset utf-8

# <IfModule mod_headers.c>
# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
# <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
# <FilesMatch "\.(appcache|crx|css|cur|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
# Header unset Content-Security-Policy
# </FilesMatch>
# </IfModule>
Expand Down Expand Up @@ -458,7 +459,7 @@ FileETag None
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"

# Favicon (cannot be renamed!)
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/x-icon "access plus 1 week"

# HTML components (HTCs)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### HEAD

* Add configurations for cursor images (`.cur`).
* Fix backup and source file blocking for Apache v2.3+ ([#5](https://github.com/h5bp/server-configs-apache/issues/5)).
* Remove filename extension to content type mappings that are already provided by Apache v2.2.0+ ([#4](https://github.com/h5bp/server-configs-apache/issues/4)).
* Improve inline comments.
Expand Down

0 comments on commit a795fff

Please sign in to comment.