Skip to content

Commit 104f232

Browse files
committed
Change vCard media type to text/vcard
* Add the `.vcard` extension to the configs. * Serve `.vcf` and `.vcard` files with the `text/vcard` media type, as the vCard media type was formally registered as `text/vcard`. Ref: http://www.iana.org/assignments/media-types/text/vcard
1 parent eaed753 commit 104f232

File tree

10 files changed

+30
-17
lines changed

10 files changed

+30
-17
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### HEAD
22

3+
* Serve `.vcf` and `.vcard` file with the `text/vcard` media type.
34
* Add configs for BlackBerry Maps location documents (`.xloc`)
45
[[20000d1](https://github.com/h5bp/server-configs-apache/commit/20000d1741701eede2e0903b2b86992d8b70c35a)].
56
* Add configs for BlackBerry App World files (`.bbaw`)
@@ -65,7 +66,6 @@
6566
[[b5bda65](https://github.com/h5bp/server-configs-apache/commit/b5bda651d2811f8f3c1f061ee97d0404ebfe8468)].
6667
* Compress WebVTT files (`.vtt`)
6768
[[0bb12c8](https://github.com/h5bp/server-configs-apache/commit/0bb12c832be9865bcfdaa1042b64381e7d723560)].
68-
6969
* Reintroduce the `filename extension` to `content type` mappings for `ico`
7070
and `svg` [[#28](https://github.com/h5bp/server-configs-apache/issues/28)].
7171

dist/.htaccess

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Options -MultiViews
128128
# the `X-UA-Compatible` response header should be send only for
129129
# HTML documents and not for the other resources.
130130

131-
<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)$">
131+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
132132
Header unset X-UA-Compatible
133133
</FilesMatch>
134134

@@ -246,7 +246,7 @@ Options -MultiViews
246246
AddType text/vnd.rim.location.xloc xloc
247247
AddType text/vtt vtt
248248
AddType text/x-component htc
249-
AddType text/x-vcard vcf
249+
AddType text/vcard vcard vcf
250250

251251
</IfModule>
252252

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

434-
# <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)$">
434+
# <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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
435435
# Header unset X-Frame-Options
436436
# </FilesMatch>
437437

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

468-
# <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)$">
468+
# <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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
469469
# Header unset Content-Security-Policy
470470
# </FilesMatch>
471471

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

635-
# <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)$">
635+
# <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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
636636
# Header unset X-XSS-Protection
637637
# </FilesMatch>
638638

src/internet_explorer/x-ua-compatible.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# the `X-UA-Compatible` response header should be send only for
2222
# HTML documents and not for the other resources.
2323

24-
<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)$">
24+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
2525
Header unset X-UA-Compatible
2626
</FilesMatch>
2727

src/media_types_and_character_encodings/media_types.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@
9292
AddType text/vnd.rim.location.xloc xloc
9393
AddType text/vtt vtt
9494
AddType text/x-component htc
95-
AddType text/x-vcard vcf
95+
AddType text/vcard vcard vcf
9696

9797
</IfModule>

src/security/content-security-policy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# the `Content-Security-Policy` response header should be send
2727
# only for HTML documents and not for the other resources.
2828

29-
<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)$">
29+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
3030
Header unset Content-Security-Policy
3131
</FilesMatch>
3232

src/security/x-frame-option.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# the `X-Frame-Options` response header should be send only for
4141
# HTML documents and not for the other resources.
4242

43-
<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)$">
43+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
4444
Header unset X-Frame-Options
4545
</FilesMatch>
4646

src/security/x-xss-protection.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# the `X-XSS-Protection` response header should be send only for
4444
# HTML documents and not for the other resources.
4545

46-
<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)$">
46+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
4747
Header unset X-XSS-Protection
4848
</FilesMatch>
4949

test/fixtures/.htaccess

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Options -MultiViews
108108
# the `X-UA-Compatible` response header should be send only for
109109
# HTML documents and not for the other resources.
110110

111-
<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)$">
111+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
112112
Header unset X-UA-Compatible
113113
</FilesMatch>
114114

@@ -226,7 +226,7 @@ Options -MultiViews
226226
AddType text/vnd.rim.location.xloc xloc
227227
AddType text/vtt vtt
228228
AddType text/x-component htc
229-
AddType text/x-vcard vcf
229+
AddType text/vcard vcard vcf
230230

231231
</IfModule>
232232

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

401-
<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)$">
401+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
402402
Header unset X-Frame-Options
403403
</FilesMatch>
404404

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

435-
<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)$">
435+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
436436
Header unset Content-Security-Policy
437437
</FilesMatch>
438438

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

602-
<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)$">
602+
<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|vcard|vcf|vtt|webapp|web[mp]|woff2?|xloc|xml|xpi)$">
603603
Header unset X-XSS-Protection
604604
</FilesMatch>
605605

test/fixtures/test.vcard

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
BEGIN:VCARD
2+
VERSION:3.0
3+
FN:test
4+
N:test;test;;;
5+
EMAIL;TYPE=INTERNET;TYPE=HOME:[email protected]
6+
END:VCARD

test/tests.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,17 @@ exports = module.exports = {
440440
}
441441
},
442442

443+
'test.vcard': {
444+
responseHeaders: {
445+
'content-encoding': null,
446+
'content-type': 'text/vcard'
447+
}
448+
},
449+
443450
'test.vcf': {
444451
responseHeaders: {
445452
'content-encoding': null,
446-
'content-type': 'text/x-vcard'
453+
'content-type': 'text/vcard'
447454
}
448455
},
449456

0 commit comments

Comments
 (0)