summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd/http.h
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-07-13 14:17:38 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-07-13 14:17:38 +0000
commit367bfebe7a160ea9f180f07cc96fd5d15c4cee1b (patch)
tree3bf50bc816bc6ef0630a65967e258925ad2cb085 /usr.sbin/httpd/http.h
parentb594af580d914545e8df314935f291516b00677b (diff)
Add support for media types (aka. MIME types): the types section is
compatible to nginx' mime.types file which can be included directly. If not present, use a few built-in defaults for html, css, txt, jpeg, gif, png, and js.
Diffstat (limited to 'usr.sbin/httpd/http.h')
-rw-r--r--usr.sbin/httpd/http.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/httpd/http.h b/usr.sbin/httpd/http.h
index 76d98e3a142..46273b7a18b 100644
--- a/usr.sbin/httpd/http.h
+++ b/usr.sbin/httpd/http.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.h,v 1.1 2014/07/12 23:34:54 reyk Exp $ */
+/* $OpenBSD: http.h,v 1.2 2014/07/13 14:17:37 reyk Exp $ */
/*
* Copyright (c) 2012 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -119,6 +119,24 @@ struct http_error {
{ 0, NULL } \
}
+struct http_mediatype {
+ char *media_name;
+ char *media_type;
+ char *media_subtype;
+};
+/* Some default media types */
+#define MEDIA_TYPES { \
+ { "css", "text", "css" }, \
+ { "html", "text", "html" }, \
+ { "txt", "text", "plain" }, \
+ { "gif", "image", "gif" }, \
+ { "jpeg", "image", "jpeg" }, \
+ { "jpg", "image", "jpeg" }, \
+ { "png", "image", "png" }, \
+ { "js", "application", "javascript" }, \
+ { NULL } \
+}
+
/* Used during runtime */
struct http_descriptor {
struct kv http_pathquery;