aboutsummaryrefslogtreecommitdiffstats
path: root/util/http.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2013-01-22 08:30:38 +0500
committerWaqas Hussain <waqas20@gmail.com>2013-01-22 08:30:38 +0500
commit0f2d3d7139c741b6bd8714048694ee16a9b11c91 (patch)
tree9938dd9411cf02b2c7cc7a82103633f7378030b8 /util/http.lua
parent1ae08f23d712da167747a7d59feac9965d6ef9ac (diff)
parentb1f22daa932ac857022412e734533ff05bad1594 (diff)
downloadprosody-0f2d3d7139c741b6bd8714048694ee16a9b11c91.tar.gz
prosody-0f2d3d7139c741b6bd8714048694ee16a9b11c91.zip
Merge 0.9->trunk
Diffstat (limited to 'util/http.lua')
-rw-r--r--util/http.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/http.lua b/util/http.lua
new file mode 100644
index 00000000..5b49d1d0
--- /dev/null
+++ b/util/http.lua
@@ -0,0 +1,15 @@
+-- Prosody IM
+-- Copyright (C) 2013 Florian Zeitz
+--
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
+local http = {};
+
+function http.contains_token(field, token)
+ field = ","..field:gsub("[ \t]", ""):lower()..",";
+ return field:find(","..token:lower()..",", 1, true) ~= nil;
+end
+
+return http;