curl-curl/tests/data/test756
Jay Satiro 3652127e81 tool_cb_hdr: suppress header output when --out-null
This change brings --out-null more in line with the documentation which
says --out-null is expected to behave like a portable -o /dev/null.

Prior to this change curl did not suppress the header output from --head
when --out-null was used to suppress output.

Assisted-by: Daniel Stenberg
Reported-by: Andrew Kvalheim

Ref: https://curl.se/docs/manpage.html#--out-null

Fixes https://github.com/curl/curl/discussions/20235
Closes https://github.com/curl/curl/pull/20256
2026-01-12 15:36:44 -05:00

75 lines
1.1 KiB
XML

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Response: 1
Content-Type: text/html
Content-Length: 8
Hello1!
</data>
<data2>
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Response: 2
Content-Type: text/html
Content-Length: 8
Hello2!
</data2>
</reply>
# Client-side
<client>
<server>
http
</server>
<features>
</features>
<name>
mix --output and --out-null
</name>
<command>
http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER0002 --out-null -o -
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET /want/%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
GET /want/%TESTNUMBER0002 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
</protocol>
<stdout>
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Response: 2
Content-Type: text/html
Content-Length: 8
Hello2!
</stdout>
</verify>
</testcase>