diff options
Diffstat (limited to 'src/web/http_bind.hrl')
-rw-r--r-- | src/web/http_bind.hrl | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/web/http_bind.hrl b/src/web/http_bind.hrl index ea9586ea5..2eac91e9d 100644 --- a/src/web/http_bind.hrl +++ b/src/web/http_bind.hrl @@ -19,14 +19,29 @@ %%% %%%---------------------------------------------------------------------- --define(CT_XML, {"Content-Type", "text/xml; charset=utf-8"}). --define(CT_PLAIN, {"Content-Type", "text/plain"}). +-define(CT_XML, + {<<"Content-Type">>, <<"text/xml; charset=utf-8">>}). --define(AC_ALLOW_ORIGIN, {"Access-Control-Allow-Origin", "*"}). --define(AC_ALLOW_METHODS, {"Access-Control-Allow-Methods", "GET, POST, OPTIONS"}). --define(AC_ALLOW_HEADERS, {"Access-Control-Allow-Headers", "Content-Type"}). --define(AC_MAX_AGE, {"Access-Control-Max-Age", "86400"}). +-define(CT_PLAIN, + {<<"Content-Type">>, <<"text/plain">>}). --define(OPTIONS_HEADER, [?CT_PLAIN, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_METHODS, - ?AC_ALLOW_HEADERS, ?AC_MAX_AGE]). --define(HEADER, [?CT_XML, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]). +-define(AC_ALLOW_ORIGIN, + {<<"Access-Control-Allow-Origin">>, <<"*">>}). + +-define(AC_ALLOW_METHODS, + {<<"Access-Control-Allow-Methods">>, + <<"GET, POST, OPTIONS">>}). + +-define(AC_ALLOW_HEADERS, + {<<"Access-Control-Allow-Headers">>, + <<"Content-Type">>}). + +-define(AC_MAX_AGE, + {<<"Access-Control-Max-Age">>, <<"86400">>}). + +-define(OPTIONS_HEADER, + [?CT_PLAIN, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_METHODS, + ?AC_ALLOW_HEADERS, ?AC_MAX_AGE]). + +-define(HEADER, + [?CT_XML, ?AC_ALLOW_ORIGIN, ?AC_ALLOW_HEADERS]). |