Remove the references to the deprecated CookieDecoder
This commit is contained in:
parent
7d102084c1
commit
0fc097cb20
@ -23,13 +23,14 @@ package io.netty.handler.codec.http;
|
|||||||
* <p>
|
* <p>
|
||||||
* Unlike the Servlet API, a query string is constructed and decomposed by
|
* Unlike the Servlet API, a query string is constructed and decomposed by
|
||||||
* {@link QueryStringEncoder} and {@link QueryStringDecoder}. {@link Cookie}
|
* {@link QueryStringEncoder} and {@link QueryStringDecoder}. {@link Cookie}
|
||||||
* support is also provided separately via {@link CookieDecoder}, {@link ClientCookieEncoder},
|
* support is also provided separately via {@link ClientCookieDecoder}, {@link ServerCookieDecoder},
|
||||||
* and {@link @ServerCookieEncoder}.
|
* {@link ClientCookieEncoder}, and {@link @ServerCookieEncoder}.
|
||||||
*
|
*
|
||||||
* @see HttpResponse
|
* @see HttpResponse
|
||||||
* @see ClientCookieEncoder
|
* @see ClientCookieEncoder
|
||||||
* @see ServerCookieEncoder
|
* @see ServerCookieEncoder
|
||||||
* @see CookieDecoder
|
* @see ClientCookieDecoder
|
||||||
|
* @see ServerCookieDecoder
|
||||||
*/
|
*/
|
||||||
public interface HttpRequest extends HttpMessage {
|
public interface HttpRequest extends HttpMessage {
|
||||||
|
|
||||||
|
@ -21,13 +21,14 @@ package io.netty.handler.codec.http;
|
|||||||
*
|
*
|
||||||
* <h3>Accessing Cookies</h3>
|
* <h3>Accessing Cookies</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* Unlike the Servlet API, {@link Cookie} support is provided separately via {@link CookieDecoder},
|
* Unlike the Servlet API, {@link Cookie} support is provided separately via {@link ClientCookieDecoder},
|
||||||
* {@link ClientCookieEncoder}, and {@link ServerCookieEncoder}.
|
* {@link ServerCookieDecoder}, {@link ClientCookieEncoder}, and {@link @ServerCookieEncoder}.
|
||||||
*
|
*
|
||||||
* @see HttpRequest
|
* @see HttpRequest
|
||||||
* @see CookieDecoder
|
|
||||||
* @see ClientCookieEncoder
|
* @see ClientCookieEncoder
|
||||||
* @see ServerCookieEncoder
|
* @see ServerCookieEncoder
|
||||||
|
* @see ClientCookieDecoder
|
||||||
|
* @see ServerCookieDecoder
|
||||||
*/
|
*/
|
||||||
public interface HttpResponse extends HttpMessage {
|
public interface HttpResponse extends HttpMessage {
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import io.netty.channel.ChannelHandlerContext;
|
|||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
import io.netty.handler.codec.DecoderResult;
|
import io.netty.handler.codec.DecoderResult;
|
||||||
import io.netty.handler.codec.http.Cookie;
|
import io.netty.handler.codec.http.Cookie;
|
||||||
import io.netty.handler.codec.http.CookieDecoder;
|
|
||||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||||
import io.netty.handler.codec.http.FullHttpResponse;
|
import io.netty.handler.codec.http.FullHttpResponse;
|
||||||
import io.netty.handler.codec.http.HttpContent;
|
import io.netty.handler.codec.http.HttpContent;
|
||||||
@ -34,6 +33,7 @@ import io.netty.handler.codec.http.HttpObject;
|
|||||||
import io.netty.handler.codec.http.HttpRequest;
|
import io.netty.handler.codec.http.HttpRequest;
|
||||||
import io.netty.handler.codec.http.LastHttpContent;
|
import io.netty.handler.codec.http.LastHttpContent;
|
||||||
import io.netty.handler.codec.http.QueryStringDecoder;
|
import io.netty.handler.codec.http.QueryStringDecoder;
|
||||||
|
import io.netty.handler.codec.http.ServerCookieDecoder;
|
||||||
import io.netty.handler.codec.http.ServerCookieEncoder;
|
import io.netty.handler.codec.http.ServerCookieEncoder;
|
||||||
import io.netty.util.CharsetUtil;
|
import io.netty.util.CharsetUtil;
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public class HttpSnoopServerHandler extends SimpleChannelInboundHandler<Object>
|
|||||||
// Encode the cookie.
|
// Encode the cookie.
|
||||||
String cookieString = request.headers().get(HttpHeaderNames.COOKIE);
|
String cookieString = request.headers().get(HttpHeaderNames.COOKIE);
|
||||||
if (cookieString != null) {
|
if (cookieString != null) {
|
||||||
Set<Cookie> cookies = CookieDecoder.decode(cookieString);
|
Set<Cookie> cookies = ServerCookieDecoder.decode(cookieString);
|
||||||
if (!cookies.isEmpty()) {
|
if (!cookies.isEmpty()) {
|
||||||
// Reset the cookies if necessary.
|
// Reset the cookies if necessary.
|
||||||
for (Cookie cookie: cookies) {
|
for (Cookie cookie: cookies) {
|
||||||
|
@ -22,7 +22,6 @@ import io.netty.channel.ChannelFutureListener;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.SimpleChannelInboundHandler;
|
import io.netty.channel.SimpleChannelInboundHandler;
|
||||||
import io.netty.handler.codec.http.Cookie;
|
import io.netty.handler.codec.http.Cookie;
|
||||||
import io.netty.handler.codec.http.CookieDecoder;
|
|
||||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||||
import io.netty.handler.codec.http.FullHttpResponse;
|
import io.netty.handler.codec.http.FullHttpResponse;
|
||||||
import io.netty.handler.codec.http.HttpContent;
|
import io.netty.handler.codec.http.HttpContent;
|
||||||
@ -36,6 +35,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
|
|||||||
import io.netty.handler.codec.http.HttpVersion;
|
import io.netty.handler.codec.http.HttpVersion;
|
||||||
import io.netty.handler.codec.http.LastHttpContent;
|
import io.netty.handler.codec.http.LastHttpContent;
|
||||||
import io.netty.handler.codec.http.QueryStringDecoder;
|
import io.netty.handler.codec.http.QueryStringDecoder;
|
||||||
|
import io.netty.handler.codec.http.ServerCookieDecoder;
|
||||||
import io.netty.handler.codec.http.ServerCookieEncoder;
|
import io.netty.handler.codec.http.ServerCookieEncoder;
|
||||||
import io.netty.handler.codec.http.multipart.Attribute;
|
import io.netty.handler.codec.http.multipart.Attribute;
|
||||||
import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
|
import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
|
||||||
@ -125,7 +125,7 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
|
|||||||
if (value == null) {
|
if (value == null) {
|
||||||
cookies = Collections.emptySet();
|
cookies = Collections.emptySet();
|
||||||
} else {
|
} else {
|
||||||
cookies = CookieDecoder.decode(value);
|
cookies = ServerCookieDecoder.decode(value);
|
||||||
}
|
}
|
||||||
for (Cookie cookie : cookies) {
|
for (Cookie cookie : cookies) {
|
||||||
responseContent.append("COOKIE: " + cookie + "\r\n");
|
responseContent.append("COOKIE: " + cookie + "\r\n");
|
||||||
@ -308,7 +308,7 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
|
|||||||
if (value == null) {
|
if (value == null) {
|
||||||
cookies = Collections.emptySet();
|
cookies = Collections.emptySet();
|
||||||
} else {
|
} else {
|
||||||
cookies = CookieDecoder.decode(value);
|
cookies = ServerCookieDecoder.decode(value);
|
||||||
}
|
}
|
||||||
if (!cookies.isEmpty()) {
|
if (!cookies.isEmpty()) {
|
||||||
// Reset the cookies if necessary.
|
// Reset the cookies if necessary.
|
||||||
|
Loading…
Reference in New Issue
Block a user