-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expect request header does not work with custom handler for PUT in ejabberd_http #3434
Comments
Can you update your ticket to provide all the information (changes in the source code, configuration, curl queries, steps) required to reproduce the problem? |
mod_put_bug.erl: -module(mod_put_bug).
-behavior(gen_mod).
-export([
start/2,
stop/1,
process/2, depends/2, mod_doc/0, mod_options/1
]).
-include("logger.hrl").
-include("ejabberd_http.hrl").
-include("translate.hrl").
%%% Module Init
%
start(_Host, _Opts) ->
ok.
%%% Module Terminate
%
stop(_Host) ->
ok.
depends(_Host, _Opts) ->
[].
mod_doc() ->
#{desc => [?T("")]}.
mod_options(_Host) -> [].
process(_Path, Request) ->
#request{ data = Data } = Request,
?DEBUG("Data length ~p", [byte_size(Data)]),
{200,
[],
"200 OK"}. ejabberd.yml addition : listen:
-
port: 8888
ip: "::"
module: ejabberd_http
request_handlers:
/put_bug : mod_put_bug
curl that works:
curl that fails:
You can see that in the DEBUG message for the failing PUT, the module doesn't get any data from ejabberd_http. Let me know if you need any more info, or if there is something wrong with my code. Thanks. |
Right, the problem is reproducible with Curl. I tested mod_http_upload, and the Gajim client can upload large files using PUT, by not using Expect. |
Environment
Configuration (only if needed): grep -Ev '^$|^\s*#' ejabberd.yml
Errors from error.log/crash.log
Bug description
When a PUT is requested with an HTTP expect HEADER, no data is passed to the request handler. The problem appears to be in ejabberd_http:extract_path_query where PUT and POST are handled differently. The problem can be seen put sending a PUT request via curl (on CLI) with a payload > 1k.
The text was updated successfully, but these errors were encountered: