RequestLine.java
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.squareup.okhttp.internal.http;
import com.squareup.okhttp.HttpUrl;
import com.squareup.okhttp.Request;
import java.net.Proxy.Type;
public final class RequestLine
{
static String get(Request paramRequest, Proxy.Type paramType)
{
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append(paramRequest.method());
localStringBuilder.append(' ');
if (includeAuthorityInRequestLine(paramRequest, paramType)) {
localStringBuilder.append(paramRequest.httpUrl());
}
for (;;)
{
localStringBuilder.append(" HTTP/1.1");
return localStringBuilder.toString();
localStringBuilder.append(requestPath(paramRequest.httpUrl()));
}
}
private static boolean includeAuthorityInRequestLine(Request paramRequest, Proxy.Type paramType)
{
return (!paramRequest.isHttps()) && (paramType == Proxy.Type.HTTP);
}
public static String requestPath(HttpUrl paramHttpUrl)
{
String str1 = paramHttpUrl.encodedPath();
String str2 = paramHttpUrl.encodedQuery();
paramHttpUrl = str1;
if (str2 != null) {
paramHttpUrl = str1 + '?' + str2;
}
return paramHttpUrl;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/squareup/okhttp/internal/http/RequestLine.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/