Class Http1Helper
java.lang.Object
cool.scx.http.x.http1.Http1Helper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]static final byte[]static final byte[]static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckRequestHasBody(ScxHttpMethod method) static booleancheckResponseHasBody(ScxHttpStatus status) static ScxUpgradecheckUpgradeRequest(Http1RequestLine requestLine, Http1Headers headers) 检查是不是 升级请求 如果不是 返回 nullstatic voidconsumeInputStream(InputStream inputStream) static PeerInfoWritablegetLocalPeer(cool.scx.tcp.ScxTCPSocket tcpSocket) static PeerInfoWritablegetRemotePeer(cool.scx.tcp.ScxTCPSocket tcpSocket) static ScxURIinferURI(ScxURI requestLineTarget, ScxHttpHeaders headers, cool.scx.tcp.ScxTCPSocket tcpSocket) 事实上我们无法拿到真正的地址 所以这里只是推测而已static voidstatic voidvalidateHost(ScxHttpHeadersWritable headers) 验证 Http/1.1 中的 Host, 这里我们只校验是否存在且只有一个值
-
Field Details
-
CONTINUE_100
public static final byte[] CONTINUE_100 -
CRLF_BYTES
public static final byte[] CRLF_BYTES -
CRLF_CRLF_BYTES
public static final byte[] CRLF_CRLF_BYTES -
CHUNKED_END_BYTES
public static final byte[] CHUNKED_END_BYTES
-
-
Constructor Details
-
Http1Helper
public Http1Helper()
-
-
Method Details
-
checkUpgradeRequest
检查是不是 升级请求 如果不是 返回 null -
sendContinue100
- Throws:
IOException
-
consumeInputStream
-
getRemotePeer
-
getLocalPeer
-
validateHost
验证 Http/1.1 中的 Host, 这里我们只校验是否存在且只有一个值 -
checkResponseHasBody
-
checkRequestHasBody
-
inferURI
public static ScxURI inferURI(ScxURI requestLineTarget, ScxHttpHeaders headers, cool.scx.tcp.ScxTCPSocket tcpSocket) 事实上我们无法拿到真正的地址 所以这里只是推测而已
-