nghttpx: Fix location rewrite is failed because request headers are empty
Previously we empties request headers after they are sent to downstream in order to free memory. But it turns out that we use request headers when rewriting location header response field. Also user reported that request headers are useful to add new features. This commits defers the deletion of request headers to the point when response headers are deleted (which is after response headers are sent to upstream client).
This commit is contained in:
parent
70a8fd59b1
commit
0209b7c083
|
@ -466,7 +466,6 @@ int Http2DownstreamConnection::push_request_headers()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
downstream_->clear_request_headers();
|
|
||||||
downstream_->reset_downstream_wtimer();
|
downstream_->reset_downstream_wtimer();
|
||||||
|
|
||||||
http2session_->notify();
|
http2session_->notify();
|
||||||
|
|
|
@ -1306,6 +1306,7 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream)
|
||||||
}
|
}
|
||||||
|
|
||||||
downstream->clear_response_headers();
|
downstream->clear_response_headers();
|
||||||
|
downstream->clear_request_headers();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,8 +297,6 @@ int HttpDownstreamConnection::push_request_headers()
|
||||||
&get_config()->downstream_read_timeout,
|
&get_config()->downstream_read_timeout,
|
||||||
&get_config()->downstream_write_timeout);
|
&get_config()->downstream_write_timeout);
|
||||||
|
|
||||||
downstream_->clear_request_headers();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -877,6 +877,7 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream)
|
||||||
}
|
}
|
||||||
|
|
||||||
downstream->clear_response_headers();
|
downstream->clear_response_headers();
|
||||||
|
downstream->clear_request_headers();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1013,6 +1013,7 @@ int SpdyUpstream::on_downstream_header_complete(Downstream *downstream)
|
||||||
}
|
}
|
||||||
|
|
||||||
downstream->clear_response_headers();
|
downstream->clear_response_headers();
|
||||||
|
downstream->clear_request_headers();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue