Commit Diff


commit - ee219d702e4b1db5a985be5087f0e682b567618b
commit + fb1212266f366f457b0c142869b8095213fc5b96
blob - 4f224eaf89d620e4b3efeb4938d77ed218d314fb
blob + 8408870b419129977d6dc71846a24b37ef80d19f
--- regress/Makefile
+++ regress/Makefile
@@ -83,3 +83,4 @@ testdata: fill-file
 	mkdir testdata/dir
 	cp hello testdata/dir
 	cp testdata/index.gmi testdata/dir/foo.gmi
+	touch testdata/test.m3u8 testdata/foo.1
blob - /dev/null
blob + b7c8e2acae6559b6aa7dff15cadcc97fae95ad2d (mode 644)
--- /dev/null
+++ regress/example.mime.types
@@ -0,0 +1,9 @@
+# example mime.types file FOR REGRESS TESTS ONLY!
+
+application/vnd.apple.mpegurl		m3u8
+application/x-perl			pl pm
+
+# some empty lines because I can
+
+text/x-mandoc				1 2 3 4 5 6 7 8 9
+text/x-mandoc				3bsd
blob - a88a2697058592a27da6dc017f5464fec6ec4749
blob + 9bce95df5248d1807ca62bba7e190440ff2f0e26
--- regress/regress
+++ regress/regress
@@ -58,5 +58,6 @@ run_test test_174_bugfix
 run_test test_proxy_relay_to
 run_test test_proxy_with_certs
 run_test test_unknown_host
+run_test test_include_mime
 
 tests_done
blob - 9fae42d965287091b16aee1f801f578eccfce96e
blob + c736a40013b06603c888111494b0fbfd5015b6d2
--- regress/tests.sh
+++ regress/tests.sh
@@ -370,3 +370,16 @@ test_unknown_host() {
 	fetch /
 	check_reply '59 Wrong/malformed host or missing SNI'
 }
+
+test_include_mime() {
+	setup_simple_test "types { include '$PWD/example.mime.types' }" ""
+
+	fetch_hdr /
+	check_reply '20 text/gemini'
+
+	fetch_hdr /test.m3u8
+	check_reply '20 application/vnd.apple.mpegurl'
+
+	fetch_hdr /foo.1
+	check_reply '20 text/x-mandoc'
+}