com.squareup.okhttp.internal.http.RawHeaders#setRequestLine ( )源码实例Demo

下面列出了com.squareup.okhttp.internal.http.RawHeaders#setRequestLine ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: L.TileLayer.Cordova   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码2 项目: IoTgo_Android_App   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码3 项目: android-discourse   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
    RawHeaders result = new RawHeaders();
    result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

    // Always set Host and User-Agent.
    result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
    result.set("User-Agent", userAgent);

    // Copy over the Proxy-Authorization header if it exists.
    if (proxyAuthorization != null) {
        result.set("Proxy-Authorization", proxyAuthorization);
    }

    // Always set the Proxy-Connection to Keep-Alive for the benefit of
    // HTTP/1.0 proxies like Squid.
    result.set("Proxy-Connection", "Keep-Alive");
    return result;
}
 
源代码4 项目: bluemix-parking-meter   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码5 项目: reader   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码6 项目: reader   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码7 项目: cordova-amazon-fireos   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码8 项目: phonegapbootcampsite   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码9 项目: CordovaYoutubeVideoPlayer   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码10 项目: cordova-android-chromeview   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码11 项目: wildfly-samples   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}
 
源代码13 项目: crosswalk-cordova-android   文件: TunnelRequest.java
/**
 * If we're creating a TLS tunnel, send only the minimum set of headers.
 * This avoids sending potentially sensitive data like HTTP cookies to
 * the proxy unencrypted.
 */
RawHeaders getRequestHeaders() {
  RawHeaders result = new RawHeaders();
  result.setRequestLine("CONNECT " + host + ":" + port + " HTTP/1.1");

  // Always set Host and User-Agent.
  result.set("Host", port == getDefaultPort("https") ? host : (host + ":" + port));
  result.set("User-Agent", userAgent);

  // Copy over the Proxy-Authorization header if it exists.
  if (proxyAuthorization != null) {
    result.set("Proxy-Authorization", proxyAuthorization);
  }

  // Always set the Proxy-Connection to Keep-Alive for the benefit of
  // HTTP/1.0 proxies like Squid.
  result.set("Proxy-Connection", "Keep-Alive");
  return result;
}