Skip to content

curl ignoring seek failure #17472

Closed
Closed
@jeroen

Description

@jeroen

I did this

If the server issues a redirect with body, for example HTTP 308, but the input has already been consumed and cannot be rewinded, curl should probably error.

For example:

echo '{"foo":123}' | curl -H "Content-Type: application/json" -T . -Lv  "https://httpbin.org/redirect-to?status_code=308&url=/put"

Shows me:

< HTTP/2 308
< date: Mon, 26 May 2025 14:48:27 GMT
< content-type: text/html; charset=utf-8
< content-length: 0
< server: gunicorn/19.9.0
* Need to rewind upload for next request
< location: /put
< access-control-allow-origin: *
< access-control-allow-credentials: true
<
* Ignoring the response-body
* Connection #0 to host httpbin.org left intact
* seek callback returned error 2
* rewind of client reader 'cr-in' failed: 65
* Issue another request to this URL: 'https://httpbin.org/put'
* Found bundle for host: 0x6000000e4150 [can multiplex]
* Re-using existing connection with host httpbin.org
* seek callback returned error 2
* rewind of client reader 'cr-in' failed: 65

So it fails to seek, but then the request claims to succeed, uploading nothing?

I expected the following

No response

curl/libcurl version

curl 8.14.0

operating system

All

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions