| 5497 | } |
| 5498 | |
| 5499 | HttpTransact::ResponseError_t |
| 5500 | HttpTransact::check_response_validity(State *s, HTTPHdr *incoming_hdr) |
| 5501 | { |
| 5502 | ink_assert(s->next_hop_scheme == URL_WKSIDX_HTTP || s->next_hop_scheme == URL_WKSIDX_HTTPS || |
| 5503 | s->next_hop_scheme == URL_WKSIDX_TUNNEL); |
| 5504 | |
| 5505 | if (incoming_hdr == nullptr) { |
| 5506 | return NON_EXISTANT_RESPONSE_HEADER; |
| 5507 | } |
| 5508 | |
| 5509 | if (incoming_hdr->type_get() != HTTP_TYPE_RESPONSE) { |
| 5510 | return NOT_A_RESPONSE_HEADER; |
| 5511 | } |
| 5512 | |
| 5513 | HTTPStatus incoming_status = incoming_hdr->status_get(); |
| 5514 | if (!incoming_status) { |
| 5515 | return MISSING_STATUS_CODE; |
| 5516 | } |
| 5517 | |
| 5518 | if (incoming_status == HTTP_STATUS_INTERNAL_SERVER_ERROR) { |
| 5519 | return STATUS_CODE_SERVER_ERROR; |
| 5520 | } |
| 5521 | |
| 5522 | if (!incoming_hdr->presence(MIME_PRESENCE_DATE)) { |
| 5523 | incoming_hdr->set_date(s->current.now); |
| 5524 | } |
| 5525 | |
| 5526 | #ifdef REALLY_NEED_TO_CHECK_DATE_VALIDITY |
| 5527 | |
| 5528 | if (incoming_hdr->presence(MIME_PRESENCE_DATE)) { |
| 5529 | time_t date_value = incoming_hdr->get_date(); |
| 5530 | if (date_value <= 0) { |
| 5531 | TxnDbg(dbg_ctl_http_trans, "Bogus date in response"); |
| 5532 | return BOGUS_OR_NO_DATE_IN_RESPONSE; |
| 5533 | } |
| 5534 | } else { |
| 5535 | TxnDbg(dbg_ctl_http_trans, "No date in response"); |
| 5536 | return BOGUS_OR_NO_DATE_IN_RESPONSE; |
| 5537 | } |
| 5538 | #endif |
| 5539 | |
| 5540 | return NO_RESPONSE_HEADER_ERROR; |
| 5541 | } |
| 5542 | |
| 5543 | bool |
| 5544 | HttpTransact::handle_trace_and_options_requests(State *s, HTTPHdr *incoming_hdr) |
nothing calls this directly
no test coverage detected