From 18e11c4dbc18f8cc48e1533ac5a9e79aa9a293cd Mon Sep 17 00:00:00 2001
From: Florian Zeitz <florob@babelmonkeys.de>
Date: Sat, 12 Jan 2013 16:55:39 +0100
Subject: util.http: New module for HTTP helper functions

---
 util/http.lua | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 util/http.lua

(limited to 'util')

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;
-- 
cgit v1.2.3