mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-25 14:24:55 +02:00
* src/web/ejabberd_http.erl: The web module now accepts HTTP
absolute URL (used behind a proxy). This apply to HTTP polling and to the web interface (Thanks to Jean-Sebastien Pedron). SVN Revision: 576
This commit is contained in:
parent
ae537d2bfb
commit
05c50cc5ca
@ -1,9 +1,13 @@
|
|||||||
2006-06-31 Mickael Remond <mickael.remond@process-one.net>
|
2006-06-02 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
* src/web/ejabberd_http_poll.erl: Messages polled between the
|
* src/web/ejabberd_http_poll.erl: Messages polled between the
|
||||||
the last client request and the polling timeout were lost. Those
|
the last client request and the polling timeout were lost. Those
|
||||||
messages are now resent using ejabberd routing mechanisms.
|
messages are now resent using ejabberd routing mechanisms.
|
||||||
|
|
||||||
|
* src/web/ejabberd_http.erl: The web module now accepts HTTP
|
||||||
|
absolute URL (used behind a proxy). This apply to HTTP polling and
|
||||||
|
to the web interface (Thanks to Jean-Sebastien Pedron).
|
||||||
|
|
||||||
2006-05-29 Mickael Remond <mickael.remond@process-one.net>
|
2006-05-29 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
* src/mod_roster.erl: According to RFC3921 section 9.2, outbound
|
* src/mod_roster.erl: According to RFC3921 section 9.2, outbound
|
||||||
|
@ -133,13 +133,17 @@ process_header(State, Data) ->
|
|||||||
SockMod = State#state.sockmod,
|
SockMod = State#state.sockmod,
|
||||||
Socket = State#state.socket,
|
Socket = State#state.socket,
|
||||||
case Data of
|
case Data of
|
||||||
{ok, {http_request, Method, Path, Version}} ->
|
{ok, {http_request, Method, Uri, Version}} ->
|
||||||
KeepAlive = case Version of
|
KeepAlive = case Version of
|
||||||
{1, 1} ->
|
{1, 1} ->
|
||||||
true;
|
true;
|
||||||
_ ->
|
_ ->
|
||||||
false
|
false
|
||||||
end,
|
end,
|
||||||
|
Path = case Uri of
|
||||||
|
{absoluteURI, _Scheme, _Host, _Port, P} -> {abs_path, P};
|
||||||
|
_ -> Uri
|
||||||
|
end,
|
||||||
State#state{request_method = Method,
|
State#state{request_method = Method,
|
||||||
request_version = Version,
|
request_version = Version,
|
||||||
request_path = Path,
|
request_path = Path,
|
||||||
@ -716,10 +720,27 @@ parse_req(Line) ->
|
|||||||
"*" ->
|
"*" ->
|
||||||
% Is this correct?
|
% Is this correct?
|
||||||
"*";
|
"*";
|
||||||
P ->
|
_ ->
|
||||||
% FIXME: Handle
|
case string:str(URI, "://") of
|
||||||
% absolute URIs
|
0 ->
|
||||||
{abs_path, P}
|
% Relative URI
|
||||||
|
% ex: /index.html
|
||||||
|
{abs_path, URI};
|
||||||
|
N ->
|
||||||
|
% Absolute URI
|
||||||
|
% ex: http://localhost/index.html
|
||||||
|
|
||||||
|
% Remove scheme
|
||||||
|
% ex: URI2 = localhost/index.html
|
||||||
|
URI2 = string:substr(URI, N + 3),
|
||||||
|
% Look for the start of the path
|
||||||
|
% (or the lack of a path thereof)
|
||||||
|
case string:chr(URI2, $/) of
|
||||||
|
0 -> {abs_path, "/"};
|
||||||
|
M -> {abs_path,
|
||||||
|
string:substr(URI2, M + 1)}
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
case VersionStr of
|
case VersionStr of
|
||||||
[] ->
|
[] ->
|
||||||
|
Loading…
Reference in New Issue
Block a user