aboutsummaryrefslogtreecommitdiffstats
path: root/util/http.lua
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
commita729bf17e251c58469aaf2f7ab7712c04154f3b6 (patch)
tree9d15ac5d4dc85f55a34ec5c99c471e09edb93304 /util/http.lua
parent1e4f3fadcdf5085364b99bd7981c21074339bb8e (diff)
downloadprosody-a729bf17e251c58469aaf2f7ab7712c04154f3b6.tar.gz
prosody-a729bf17e251c58469aaf2f7ab7712c04154f3b6.zip
util.http: New module for HTTP helper functions
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;