bool notedUseOfBuffer = false;
bool tePresent = false;
bool deChunked = false;
+ bool mustReplyToOptions = false;
bool unsupportedTe = false;
/* We have an initial client stream in place should it be needed */
} else
conn->cleanDechunkingRequest();
+ if (method == METHOD_TRACE || method == METHOD_OPTIONS)
+ request->max_forwards = request->header.getInt64(HDR_MAX_FORWARDS);
+
+ mustReplyToOptions = (method == METHOD_OPTIONS) && (request->max_forwards == 0);
unsupportedTe = tePresent && !deChunked;
- if (!urlCheckRequest(request) || unsupportedTe) {
+ if (!urlCheckRequest(request) || mustReplyToOptions || unsupportedTe) {
clientStreamNode *node = context->getClientReplyContext();
clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
assert (repContext);
return;
}
- /* TODO: handle OPTIONS request on max_forwards == 0 as well */
+ // OPTIONS with Max-Forwards:0 handled in clientProcessRequest()
if (context->http->request->method == METHOD_TRACE) {
if (context->http->request->max_forwards == 0) {
}
#endif
- if (request->method == METHOD_TRACE || request->method == METHOD_OPTIONS) {
- request->max_forwards = req_hdr->getInt64(HDR_MAX_FORWARDS);
- }
request->flags.cachable = http->request->cacheable();