aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2013-01-12 16:55:39 +0100
committerFlorian Zeitz <florob@babelmonkeys.de>2013-01-12 16:55:39 +0100
commit18e11c4dbc18f8cc48e1533ac5a9e79aa9a293cd (patch)
tree9d15ac5d4dc85f55a34ec5c99c471e09edb93304 /util
parentaa500e0a04a69681f33875ae15972a488f094f03 (diff)
downloadprosody-18e11c4dbc18f8cc48e1533ac5a9e79aa9a293cd.tar.gz
prosody-18e11c4dbc18f8cc48e1533ac5a9e79aa9a293cd.zip
util.http: New module for HTTP helper functions
Diffstat (limited to 'util')
-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;