Mercurial > prosody-hg
annotate util/http.lua @ 5428:4cc7df30f521
prosody: load rostermanager after usermanager during environment initialization.
| author | Marco Cirillo <maranda@lightwitch.org> |
|---|---|
| date | Fri, 05 Apr 2013 04:49:32 +0000 |
| parents | cc9d460aa779 |
| children | 84162b81c863 |
| rev | line source |
|---|---|
|
5299
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
1 -- Prosody IM |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
2 -- Copyright (C) 2013 Florian Zeitz |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
3 -- |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
4 -- This project is MIT/X11 licensed. Please see the |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
5 -- COPYING file in the source package for more information. |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
6 -- |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
7 |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
8 local http = {}; |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
9 |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
10 function http.contains_token(field, token) |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
11 field = ","..field:gsub("[ \t]", ""):lower()..","; |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
12 return field:find(","..token:lower()..",", 1, true) ~= nil; |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
13 end |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
14 |
|
cc9d460aa779
util.http: New module for HTTP helper functions
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
15 return http; |
