projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0555da
)
util.http: New module for HTTP helper functions
author
Florian Zeitz
<florob@babelmonkeys.de>
Sat, 12 Jan 2013 15:55:39 +0000
(16:55 +0100)
committer
Florian Zeitz
<florob@babelmonkeys.de>
Sat, 12 Jan 2013 15:55:39 +0000
(16:55 +0100)
util/http.lua
[new file with mode: 0644]
patch
|
blob
diff --git a/util/http.lua
b/util/http.lua
new file mode 100644
(file)
index 0000000..
5b49d1d
--- /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;