mimetypes.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * uhttpd - Tiny single-threaded httpd
  3. *
  4. * Copyright (C) 2010-2013 Jo-Philipp Wich <xm@subsignal.org>
  5. * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for any
  8. * purpose with or without fee is hereby granted, provided that the above
  9. * copyright notice and this permission notice appear in all copies.
  10. *
  11. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  12. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  13. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  14. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  15. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  16. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  17. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _UHTTPD_MIMETYPES_
  20. struct mimetype {
  21. const char *extn;
  22. const char *mime;
  23. };
  24. static const struct mimetype uh_mime_types[] = {
  25. { "txt", "text/plain" },
  26. { "log", "text/plain" },
  27. { "js", "text/javascript" },
  28. { "css", "text/css" },
  29. { "htm", "text/html" },
  30. { "html", "text/html" },
  31. { "diff", "text/x-patch" },
  32. { "patch", "text/x-patch" },
  33. { "c", "text/x-csrc" },
  34. { "h", "text/x-chdr" },
  35. { "o", "text/x-object" },
  36. { "ko", "text/x-object" },
  37. { "bmp", "image/bmp" },
  38. { "gif", "image/gif" },
  39. { "png", "image/png" },
  40. { "jpg", "image/jpeg" },
  41. { "jpeg", "image/jpeg" },
  42. { "svg", "image/svg+xml" },
  43. { "json", "application/json" },
  44. { "jsonp", "application/javascript" },
  45. { "zip", "application/zip" },
  46. { "pdf", "application/pdf" },
  47. { "xml", "application/xml" },
  48. { "xsl", "application/xml" },
  49. { "doc", "application/msword" },
  50. { "ppt", "application/vnd.ms-powerpoint" },
  51. { "xls", "application/vnd.ms-excel" },
  52. { "odt", "application/vnd.oasis.opendocument.text" },
  53. { "odp", "application/vnd.oasis.opendocument.presentation" },
  54. { "pl", "application/x-perl" },
  55. { "sh", "application/x-shellscript" },
  56. { "php", "application/x-php" },
  57. { "deb", "application/x-deb" },
  58. { "iso", "application/x-cd-image" },
  59. { "tar.gz", "application/x-compressed-tar" },
  60. { "tgz", "application/x-compressed-tar" },
  61. { "gz", "application/x-gzip" },
  62. { "tar.bz2", "application/x-bzip-compressed-tar" },
  63. { "tbz", "application/x-bzip-compressed-tar" },
  64. { "bz2", "application/x-bzip" },
  65. { "tar", "application/x-tar" },
  66. { "rar", "application/x-rar-compressed" },
  67. { "mp3", "audio/mpeg" },
  68. { "ogg", "audio/x-vorbis+ogg" },
  69. { "wav", "audio/x-wav" },
  70. { "aac", "audio/aac" },
  71. { "mpg", "video/mpeg" },
  72. { "mpeg", "video/mpeg" },
  73. { "avi", "video/x-msvideo" },
  74. { "mov", "video/quicktime" },
  75. { "mp4", "video/mp4" },
  76. { "README", "text/plain" },
  77. { "log", "text/plain" },
  78. { "cfg", "text/plain" },
  79. { "conf", "text/plain" },
  80. { "pac", "application/x-ns-proxy-autoconfig" },
  81. { "wpad.dat", "application/x-ns-proxy-autoconfig" },
  82. { "appcache", "text/cache-manifest" },
  83. { "manifest", "text/cache-manifest" },
  84. { NULL, NULL }
  85. };
  86. #endif