Skip to content

Body is empty if content length is not set #170

@brodo

Description

@brodo

If you make a PUT request like this: echo "hello world" | curl -T - localhost:3000 curl will not set the content-length header:

echo "hello world" | curl -T - -v localhost:1337
* Host localhost:1337 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying [::1]:1337...
* connect to ::1 port 1337 from ::1 port 57406 failed: Connection refused
*   Trying 127.0.0.1:1337...
* Connected to localhost (127.0.0.1) port 1337
> PUT / HTTP/1.1
> Host: localhost:1337
> User-Agent: curl/8.7.1
> Accept: */*
> Transfer-Encoding: chunked
> Expect: 100-continue
>
< HTTP/1.1 100
< Content-Length: 0
<
} [22 bytes data]
* upload completely sent off: 27 bytes

If you do this, httpz.Request.body() retuns null. In Zap, this works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions