possible that there can be different behavior at the protocol level if
request_rec isn't really a request but a response.
This stems from the fact that request bodies must be indicated by
Content-Length or Transfer-Encoding, but response bodies do not. The
recent change to ap_http_filter to return EOS if there isn't a body broke
proxy. Therefore, there must be some way for the proxy to indicate that
this is a response. Accordingly, ap_http_filter can allow the BODY_NONE
iff this is a response.
Since r->proxyreq is set to PROXYREQ_PROXY even for the original request
from the client, that value isn't sufficient. Hence, the introduction of
PROXYREQ_RESPONSE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95390
13f79535-47bb-0310-9956-
ffa450edef68
/** HTTP/0.9, "simple" request (e.g. GET /foo\n w/no headers) */
int assbackwards;
/** A proxy request (calculated during post_read_request/translate_name)
- * possible values PROXYREQ_NONE, PROXYREQ_PROXY, PROXYREQ_REVERSE
+ * possible values PROXYREQ_NONE, PROXYREQ_PROXY, PROXYREQ_REVERSE,
+ * PROXYREQ_RESPONSE
*/
int proxyreq;
/** HEAD request, as opposed to GET */
#define PROXYREQ_NONE 0 /**< No proxy */
#define PROXYREQ_PROXY 1 /**< Standard proxy */
#define PROXYREQ_REVERSE 2 /**< Reverse proxy */
+#define PROXYREQ_RESPONSE 3 /**< Origin response */
/* @} */
* RFC 2616 Section 4.4 note 5 states that connection-close
* is invalid for a request entity - request bodies must be
* denoted by C-L or T-E: chunked.
+ *
+ * Note that since the proxy uses this filter to handle the
+ * proxied *response*, proxy responses MUST be exempt.
*/
- if (ctx->state == BODY_NONE) {
+ if (ctx->state == BODY_NONE && f->r->proxyreq != PROXYREQ_RESPONSE) {
e = apr_bucket_eos_create(f->r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(b, e);
return APR_SUCCESS;
*/
rp = ap_proxy_make_fake_req(origin, r);
+ /* In case anyone needs to know, this is a fake request that is really a
+ * response.
+ */
+ rp->proxyreq = PROXYREQ_RESPONSE;
while (received_continue) {
apr_brigade_cleanup(bb);