processone / processone/ejabberd

Expect request header does not work with custom handler for PUT in ejabberd_http

Open
#3,434 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Erlang
Stars
6.7k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Environment

  • ejabberd version: 20.07
  • Erlang version: Erlang/OTP 22
  • OS: MacOS/CentOS
  • Installed from: source

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ejabberd_http:extract_path_query and reproduce the issue with curl using a PUT request with an Expect header and a payload over 1k. Trace how PUT and POST request data reach the custom handler; the fix is complete when the handler receives the PUT payload in this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.