Mailing List Archive

#1783: POST with empty body and absent content-length returns 503
#1783: POST with empty body and absent content-length returns 503
-----------------------------+--------------------
Reporter: fascinatedcow | Type: defect
Status: new | Priority: normal
Milestone: Varnish 4.1-TP1 | Component: build
Version: 4.1.0-TP1 | Severity: normal
Keywords: |
-----------------------------+--------------------
Hi,

I think I have found a bug in 4.1.0-tp1.

As per subject, if I POST without specifying a body and without setting a
content-length header, I'm getting "503 Backend fetch failed" from
varnish, after a few seconds pause. I can see that varnish is sending the
request to the backend and getting a response back. I'm using curl like
so:


{{{
curl -v -XPOST http://<ip>/ -H 'Host: <hostname>'
}}}


This doesn't happen with varnish 3 or 4.0.3.

Please let me know if you need more information.

Regards,

Matt

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1783>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1783: POST with empty body and absent content-length returns 503 [ In reply to ]
#1783: POST with empty body and absent content-length returns 503
---------------------------+------------------------------
Reporter: fascinatedcow | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: Varnish 4.1-TP1
Component: build | Version: 4.1.0-TP1
Severity: normal | Resolution: invalid
Keywords: |
---------------------------+------------------------------
Changes (by phk):

* status: new => closed
* resolution: => invalid


Comment:

A POST without Content-Length or Transfer-Encoding is not legal.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1783#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1783: POST with empty body and absent content-length returns 503 [ In reply to ]
#1783: POST with empty body and absent content-length returns 503
---------------------------+------------------------------
Reporter: fascinatedcow | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: Varnish 4.1-TP1
Component: build | Version: 4.1.0-TP1
Severity: normal | Resolution: invalid
Keywords: |
---------------------------+------------------------------

Comment (by fascinatedcow):

Hi PHK,

OK, you're the expert so I'll take your word for it. But then why not just
reject the request? Why is there a pause, and why send the request to the
backend and report a backend error. It's not a backend error.

Cheers,

Matt

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1783#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1783: POST with empty body and absent content-length returns 503 [ In reply to ]
--------
In message <066.57f8aef08e7d1b56411d15f83d8d33a1@varnish-cache.org>, "Varnish"
writes:

> OK, you're the expert so I'll take your word for it. But then why not just
> reject the request? Why is there a pause, and why send the request to the
> backend and report a backend error. It's not a backend error.

The pause is there because if it had been a HTTP/1.0 the body could
have followed without Content-Length/Transfer-Encoding and be terminated
by the client closing the socket.

Doing that fall-back is probably overdoing it, if the client explicitly
sent a HTTP/1.1 header.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1783: POST with empty body and absent content-length returns 503 [ In reply to ]
#1783: POST with empty body and absent content-length returns 503
---------------------------+------------------------------
Reporter: fascinatedcow | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone: Varnish 4.1-TP1
Component: build | Version: 4.1.0-TP1
Severity: normal | Resolution:
Keywords: |
---------------------------+------------------------------
Changes (by phk):

* status: closed => reopened
* resolution: invalid =>


Comment:

Hmm, it seems that this was "clarified" in the HTTPbis RFCs, so POST
without a body now is valid.

Reopening.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1783#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1783: POST with empty body and absent content-length returns 503 [ In reply to ]
#1783: POST with empty body and absent content-length returns 503
---------------------------+----------------------------------------
Reporter: fascinatedcow | Owner: Poul-Henning Kamp <phk@…>
Type: defect | Status: closed
Priority: normal | Milestone: Varnish 4.1-TP1
Component: build | Version: 4.1.0-TP1
Severity: normal | Resolution: fixed
Keywords: |
---------------------------+----------------------------------------
Changes (by Poul-Henning Kamp <phk@…>):

* status: reopened => closed
* owner: => Poul-Henning Kamp <phk@…>
* resolution: => fixed


Comment:

In [a6a6e97a4db6e94b14f81af55fea4d07aa06d0af]:
{{{
#!CommitTicketReference repository=""
revision="a6a6e97a4db6e94b14f81af55fea4d07aa06d0af"
Align code with RFC7230 section 3.3.3 which allows POST without a body.

Fixes: #1783
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1783#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs