Roxen.git / server / protocols / http.pike

version» Context lines:

Roxen.git/server/protocols/http.pike:1039:    }    break;    case "authorization": rawauth = contents; break;    case "referer": referer = ({contents}); break;    case "if-modified-since": since=contents; break;    case "if-match": break; // Not supported yet.    case "if-none-match":    none_match = (multiset)((contents-" ")/",");    break;    +  case "if": + #ifdef IF_HEADER_DEBUG +  werror("IF: Raw header: %O\n", contents); + #endif +  if (!has_prefix(String.trim_all_whites(contents), "<")) { +  // Prefix with the base resource id to make the header +  // idempotent with respect to subrequests. +  contents = +  sprintf("<%s> %s", +  replace(raw_url, ({ " ", ">" }), ({ "%20", "%3e" })), +  contents); +  request_headers->if = contents; + #ifdef IF_HEADER_DEBUG +  werror("IF: Adjusted header: %O\n", contents); + #endif +  } +  break; +     case "proxy-authorization":    array y;    y = contents / " ";    if(sizeof(y) < 2)    break;    y[1] = decode(y[1]);    misc->proxyauth=y;    break;       case "user-agent":
Roxen.git/server/protocols/http.pike:2745:       // The full header block (prot + " " + code + head_string + variant_string).    string full_headers="";      #if 0    REQUEST_WERR(sprintf("HTTP: Sending result for prot:%O, method:%O, file:%O",    prot, method, file));   #endif    if(!file->raw && (prot != "HTTP/0.9"))    { -  if (!sizeof (file) && multi_status) +  if ((sizeof(file) <= 1) && multi_status) { +  // NB: Configuration::examine_return_mapping() adds an +  // empty extra_heads entry to the mapping. +  if ((sizeof(file) != 1) || file->extra_heads) {    file = multi_status->http_answer(); -  +  } +  }       if (file->error == Protocols.HTTP.HTTP_NO_CONTENT) {    file->len = 0;    file->data = "";    }       string head_status = file->rettext;    if (head_status) {    if (!file->file && !file->data &&    (!file->type || file->type == "text/html")) {