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
tool/-T: perform non-chunked transfer for stdin if it is a regular file #12178
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,9 @@ HTTP chunked PUT to HTTP 1.0 server with authorization | |
<command> | ||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T - -u testuser:testpass --anyauth | ||
</command> | ||
<stdin> | ||
<stdin pipe="yes"> | ||
This is data we upload with PUT | ||
it comes from stdin so MUST be sent | ||
it comes from a pipe so MUST be sent | ||
with chunked encoding | ||
which is impossible in HTTP/1.0 | ||
</stdin> | ||
|
@@ -53,7 +53,7 @@ which is impossible in HTTP/1.0 | |
# Verify data after the test has been "shot" | ||
<verify> | ||
<errorcode> | ||
25 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
65 | ||
</errorcode> | ||
<protocol> | ||
PUT /%TESTNUMBER HTTP/1.1 | ||
|
@@ -64,12 +64,12 @@ Transfer-Encoding: chunked | |
Expect: 100-continue | ||
|
||
%if hyper | ||
7A | ||
7B | ||
%else | ||
7a | ||
7b | ||
%endif | ||
This is data we upload with PUT | ||
it comes from stdin so MUST be sent | ||
it comes from a pipe so MUST be sent | ||
with chunked encoding | ||
which is impossible in HTTP/1.0 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,9 @@ HTTP chunked PUT to HTTP 1.0 server with redirect | |
<command> | ||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T - -L | ||
</command> | ||
<stdin> | ||
<stdin pipe="yes"> | ||
This is data we upload with PUT | ||
it comes from stdin so MUST be sent | ||
it comes from a pipe so MUST be sent | ||
with chunked encoding | ||
which is impossible in HTTP/1.0 | ||
</stdin> | ||
|
@@ -47,7 +47,7 @@ which is impossible in HTTP/1.0 | |
# Verify data after the test has been "shot" | ||
<verify> | ||
<errorcode> | ||
25 | ||
65 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to change the error code to |
||
</errorcode> | ||
<protocol> | ||
PUT /%TESTNUMBER HTTP/1.1 | ||
|
@@ -58,12 +58,12 @@ Transfer-Encoding: chunked | |
Expect: 100-continue | ||
|
||
%if hyper | ||
7A | ||
7B | ||
%else | ||
7a | ||
7b | ||
%endif | ||
This is data we upload with PUT | ||
it comes from stdin so MUST be sent | ||
it comes from a pipe so MUST be sent | ||
with chunked encoding | ||
which is impossible in HTTP/1.0 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<testcase> | ||
<info> | ||
<keywords> | ||
HTTP | ||
HTTP PUT | ||
</keywords> | ||
</info> | ||
|
||
# Server-side | ||
<reply> | ||
<data> | ||
HTTP/1.0 200 OK swsclose | ||
Date: Tue, 09 Nov 2010 14:49:00 GMT | ||
Server: test-server/fake | ||
|
||
blablabla | ||
|
||
</data> | ||
</reply> | ||
|
||
# Client-side | ||
<client> | ||
<server> | ||
http | ||
</server> | ||
<name> | ||
HTTP PUT of regular file stdin | ||
</name> | ||
<command> | ||
http://%HOSTIP:%HTTPPORT/bzz/%TESTNUMBER -T - | ||
</command> | ||
<stdin> | ||
more than one byte | ||
</stdin> | ||
</client> | ||
|
||
# Verify data after the test has been "shot" | ||
<verify> | ||
<protocol> | ||
PUT /bzz/%TESTNUMBER HTTP/1.1 | ||
Host: %HOSTIP:%HTTPPORT | ||
User-Agent: curl/%VERSION | ||
Accept: */* | ||
Content-Length: 19 | ||
|
||
more than one byte | ||
</protocol> | ||
</verify> | ||
</testcase> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give an example of this happening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
For stdin as upload file (
-T -
), it is the third example in the PR description:{ read -r x && src/curl -T - localhost:40400 ;} < ~/.bashrc
.For an example of
-T /dev/fd/N
etc on BSDs, see #12177.