pike.git / lib / modules / Protocols.pmod / HTTP.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:176:    mapping(string:string|array(string)) proxy_headers;       if( user || password )    {    if( !request_headers )    proxy_headers = ([]);    else    proxy_headers = request_headers + ([]);       proxy_headers["Proxy-Authorization"] = "Basic " -  + MIME.encode_base64((user || "") + ":" + (password || "")); +  + MIME.encode_base64((user || "") + ":" + (password || ""), 1);    }       if (url->scheme == "http") {    if( query_variables )    url->set_query_variables( url->get_query_variables() +    query_variables );    string web_url = (string)url;       // Note: url object is wrecked here -  +  url->scheme = proxy->scheme;    url->host = proxy->host;    url->port = proxy->port;    query_variables = url->query = 0;    url->path = web_url;    } else if (url->scheme == "https") {   #ifdef HTTP_QUERY_DEBUG    werror("Proxied SSL request.\n");   #endif    if (!con || (con->host != url->host) || (con->port != url->port)) {    // Make a CONNECT request to the proxy,
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:275:       mapping default_headers = ([    "user-agent" : "Mozilla/5.0 (compatible; MSIE 6.0; Pike HTTP client)"    " Pike/" + __REAL_MAJOR__ + "." + __REAL_MINOR__ + "." + __REAL_BUILD__,    "host" : url->host +    (url->port!=(url->scheme=="https"?443:80)?":"+url->port:"")]);       if(url->user || url->password)    default_headers->authorization = "Basic "    + MIME.encode_base64(url->user + ":" + -  (url->password || "")); +  (url->password || ""), +  1);       if(!request_headers)    request_headers = default_headers;    else    request_headers = default_headers |    mkmapping(lower_case(indices(request_headers)[*]),    values(request_headers));       string query=url->query;    if(query_variables && sizeof(query_variables))
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:406:    request_headers = ([]);    mapping default_headers = ([    "user-agent" : "Mozilla/5.0 (compatible; MSIE 6.0; Pike HTTP client)"    " Pike/" + __REAL_MAJOR__ + "." + __REAL_MINOR__ + "." + __REAL_BUILD__,    "host" : url->host +    (url->port!=(url->scheme=="https"?443:80)?":"+url->port:"")]);       if(url->user || url->password)    default_headers->authorization = "Basic "    + MIME.encode_base64(url->user + ":" + -  (url->password || "")); +  (url->password || ""), +  1);    request_headers = default_headers | request_headers;       string query=url->query;    if(query_variables && sizeof(query_variables))    {    if(query)    query+="&"+http_encode_query(query_variables);    else    query=http_encode_query(query_variables);    }
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:446:      protected void https_proxy_connect_ok(Protocols.HTTP.Query con,    array(mixed) orig_cb_info,    Standards.URI url, string method,    mapping(string:string) query_variables,    mapping(string:string) request_headers,    string data)   {    con->set_callbacks(@orig_cb_info);    +  // Install the timeout handler for the interval until +  // the TLS connection is up. +  con->init_async_timeout();    con->con->set_nonblocking(0,    lambda() { -  +  // Remove the timeout handler; it will be +  // reinstated by do_async_method() below. +  con->remove_async_timeout();    do_async_method(method, url, query_variables,    request_headers, con, data);    }, con->async_failed);       con->headers["connection"] = "keep-alive";    con->headers["content-length"] = "0";    con->host = url->host;    con->port = url->port;    con->https = 1;    con->start_tls(0);
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:524:    mapping(string:string|array(string)) proxy_headers;       if( user || password )    {    if( !request_headers )    proxy_headers = ([]);    else    proxy_headers = request_headers + ([]);       proxy_headers["Proxy-Authorization"] = "Basic " -  + MIME.encode_base64((user || "") + ":" + (password || "")); +  + MIME.encode_base64((user || "") + ":" + (password || ""), 1);    }       if (url->scheme == "http") {    if( query_variables )    url->set_query_variables( url->get_query_variables() +    query_variables );    string web_url = (string)url;       // Note: url object is wrecked here -  +  url->scheme = proxy->scheme;    url->host = proxy->host;    url->port = proxy->port;    query_variables = url->query = 0;    url->path = web_url;    } else if(url->scheme == "https") {   #ifdef HTTP_QUERY_DEBUG    werror("Proxied SSL request.\n");   #endif    if (!con || (con->host != url->host) || (con->port != url->port)) {    // Make a CONNECT request to the proxy,