Skip to content

Commit

Permalink
Deprecate unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev authored and xcl(徐程林) committed Aug 16, 2020
1 parent 02b5330 commit 4994f8c
Showing 1 changed file with 7 additions and 11 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,7 @@
import org.springframework.http.HttpHeaders;
import org.springframework.lang.Nullable;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;

/**
* An {@link org.springframework.http.HttpHeaders} variant that adds support for
Expand Down Expand Up @@ -56,7 +57,7 @@ public class WebSocketHttpHeaders extends HttpHeaders {
* Create a new instance.
*/
public WebSocketHttpHeaders() {
this(new HttpHeaders(), false);
this(new HttpHeaders());
}

/**
Expand All @@ -65,21 +66,16 @@ public WebSocketHttpHeaders() {
* @param headers the HTTP headers to wrap
*/
public WebSocketHttpHeaders(HttpHeaders headers) {
this(headers, false);
}

/**
* Private constructor that can create read-only {@code WebSocketHttpHeader} instances.
*/
private WebSocketHttpHeaders(HttpHeaders headers, boolean readOnly) {
this.headers = readOnly ? HttpHeaders.readOnlyHttpHeaders(headers) : headers;
this.headers = headers;
}

/**
* Returns {@code WebSocketHttpHeaders} object that can only be read, not written to.
* @deprecated as of 5.2.7 in favor of {@link HttpHeaders#readOnlyHttpHeaders(MultiValueMap)}
*/
@Deprecated
public static WebSocketHttpHeaders readOnlyWebSocketHttpHeaders(WebSocketHttpHeaders headers) {
return new WebSocketHttpHeaders(headers, true);
return new WebSocketHttpHeaders(HttpHeaders.readOnlyHttpHeaders(headers));
}


Expand Down

0 comments on commit 4994f8c

Please sign in to comment.