Skip to content

Commit

Permalink
Add configs for BlackBerry Maps location documents
Browse files Browse the repository at this point in the history
Ensure that `.xloc` text files will:

 * be served with the `text/vnd.rim.location.xloc ` media type
 * have their character encoding specified as `UTF-8`
 * be compressed (they are basically XML files, therefore, they
   compress quite nicely)
 * not be served with any of the `HTML` document related headers

Ref: http://www.manualslib.com/manual/368494/Blackberry-Java-Development-Environment-Gps-And-Maps-Development-Guide.html?page=28
     http://docs.blackberry.com/en/developers/deliverables/18168/BlackBerry_Browser-Feature_and_Technical_Overview--1214041-0804111258-001-6.0-US.pdf

Ref: #43
  • Loading branch information
alrra committed Oct 16, 2014
1 parent ef58054 commit 20000d1
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### HEAD

* Add configs for BlackBerry Maps location documents (`.xloc`).
* Add configs for BlackBerry App World files (`.bbaw`)
[[352fb62](https://github.com/h5bp/server-configs-apache/commit/352fb62daae4b57cf605c1eb3a836385f6f7e01f)].

Expand Down
11 changes: 7 additions & 4 deletions dist/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Options -MultiViews
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>

Expand Down Expand Up @@ -243,6 +243,7 @@ Options -MultiViews
AddType application/xml atom rdf rss xml
AddType image/webp webp
AddType image/x-icon cur ico
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
AddType text/x-vcard vcf
Expand Down Expand Up @@ -271,6 +272,7 @@ AddDefaultCharset utf-8
.topojson \
.vtt \
.webapp \
.xloc \
.xml
</IfModule>

Expand Down Expand Up @@ -429,7 +431,7 @@ AddDefaultCharset utf-8
# # the `X-Frame-Options` response header should be send only for
# # HTML documents and not for the other resources.

# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
# Header unset X-Frame-Options
# </FilesMatch>

Expand Down Expand Up @@ -463,7 +465,7 @@ AddDefaultCharset utf-8
# # the `Content-Security-Policy` response header should be send
# # only for HTML documents and not for the other resources.

# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
# Header unset Content-Security-Policy
# </FilesMatch>

Expand Down Expand Up @@ -630,7 +632,7 @@ AddDefaultCharset utf-8
# # the `X-XSS-Protection` response header should be send only for
# # HTML documents and not for the other resources.

# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
# <FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
# Header unset X-XSS-Protection
# </FilesMatch>

Expand Down Expand Up @@ -720,6 +722,7 @@ AddDefaultCharset utf-8
"text/html" \
"text/javascript" \
"text/plain" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/xml"
Expand Down
2 changes: 1 addition & 1 deletion src/internet_explorer/x-ua-compatible.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ AddDefaultCharset utf-8
.topojson \
.vtt \
.webapp \
.xloc \
.xml
</IfModule>
1 change: 1 addition & 0 deletions src/media_types_and_character_encodings/media_types.conf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
AddType application/xml atom rdf rss xml
AddType image/webp webp
AddType image/x-icon cur ico
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
AddType text/x-vcard vcf
Expand Down
2 changes: 1 addition & 1 deletion src/security/content-security-policy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# the `Content-Security-Policy` response header should be send
# only for HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset Content-Security-Policy
</FilesMatch>

Expand Down
2 changes: 1 addition & 1 deletion src/security/x-frame-option.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# the `X-Frame-Options` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-Frame-Options
</FilesMatch>

Expand Down
2 changes: 1 addition & 1 deletion src/security/x-xss-protection.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# the `X-XSS-Protection` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-XSS-Protection
</FilesMatch>

Expand Down
1 change: 1 addition & 0 deletions src/web_performance/compression.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"text/html" \
"text/javascript" \
"text/plain" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/xml"
Expand Down
11 changes: 7 additions & 4 deletions test/fixtures/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Options -MultiViews
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>

Expand Down Expand Up @@ -223,6 +223,7 @@ Options -MultiViews
AddType application/xml atom rdf rss xml
AddType image/webp webp
AddType image/x-icon cur ico
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
AddType text/x-vcard vcf
Expand Down Expand Up @@ -251,6 +252,7 @@ AddDefaultCharset utf-8
.topojson \
.vtt \
.webapp \
.xloc \
.xml
</IfModule>

Expand Down Expand Up @@ -396,7 +398,7 @@ AddDefaultCharset utf-8
# the `X-Frame-Options` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-Frame-Options
</FilesMatch>

Expand Down Expand Up @@ -430,7 +432,7 @@ AddDefaultCharset utf-8
# the `Content-Security-Policy` response header should be send
# only for HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset Content-Security-Policy
</FilesMatch>

Expand Down Expand Up @@ -597,7 +599,7 @@ AddDefaultCharset utf-8
# the `X-XSS-Protection` response header should be send only for
# HTML documents and not for the other resources.

<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xml|xpi)$">
<FilesMatch "\.(appcache|atom|bbaw|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
Header unset X-XSS-Protection
</FilesMatch>

Expand Down Expand Up @@ -673,6 +675,7 @@ AddDefaultCharset utf-8
"text/html" \
"text/javascript" \
"text/plain" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/xml"
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/test.xloc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<lbs id='Kit' >
<location lon='-0802300' lat='4327000' label='Kitchener, ON' description='Kitchener' zoom='10'/>
</lbs>
8 changes: 6 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ exports = module.exports = {

'test.bbaw': {
responseHeaders: {
'cache-control': 'max-age=2592000, no-transform',
'content-encoding': null,
'content-type': 'application/x-bb-appworld; charset=utf-8'
}
Expand Down Expand Up @@ -135,7 +134,6 @@ exports = module.exports = {

'test.f4a': {
responseHeaders: {
'cache-control': 'max-age=2592000, no-transform',
'content-encoding': null,
'content-type': 'audio/mp4'
}
Expand Down Expand Up @@ -496,6 +494,12 @@ exports = module.exports = {
}
},

'test.xloc': {
responseHeaders: {
'content-type': 'text/vnd.rim.location.xloc; charset=utf-8'
}
},

'test.xml': {
responseHeaders: {
'cache-control': 'max-age=0, no-transform',
Expand Down

0 comments on commit 20000d1

Please sign in to comment.