Skip to content

Commit

Permalink
Merge pull request undertow-io#913 from baranowb/UNDERTOW-1755
Browse files Browse the repository at this point in the history
[UNDERTOW-1755] - remove doubled definitions of some variables
  • Loading branch information
fl4via committed Aug 24, 2020
2 parents c64f1db + 1c4bd2d commit 818bfe3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import io.undertow.util.HeaderMap;
import io.undertow.util.HeaderValues;
import io.undertow.util.Headers;
import io.undertow.util.HttpString;
import io.undertow.util.ImmediatePooledByteBuffer;
import io.undertow.util.Methods;
import io.undertow.util.ParameterLimitException;
Expand All @@ -56,6 +55,11 @@

import javax.net.ssl.SSLSession;

import static io.undertow.protocols.http2.Http2Channel.AUTHORITY;
import static io.undertow.protocols.http2.Http2Channel.METHOD;
import static io.undertow.protocols.http2.Http2Channel.PATH;
import static io.undertow.protocols.http2.Http2Channel.SCHEME;

/**
* The recieve listener for a Http2 connection.
* <p>
Expand All @@ -65,11 +69,6 @@
*/
public class Http2ReceiveListener implements ChannelListener<Http2Channel> {

static final HttpString METHOD = new HttpString(":method");
static final HttpString PATH = new HttpString(":path");
static final HttpString SCHEME = new HttpString(":scheme");
static final HttpString AUTHORITY = new HttpString(":authority");

private final HttpHandler rootHandler;
private final long maxEntitySize;
private final OptionMap undertowOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
import io.undertow.util.HttpString;
import io.undertow.util.StatusCodes;

import static io.undertow.protocols.http2.Http2Channel.AUTHORITY;
import static io.undertow.protocols.http2.Http2Channel.METHOD;
import static io.undertow.protocols.http2.Http2Channel.PATH;
import static io.undertow.protocols.http2.Http2Channel.SCHEME;

/**
* A server connection. There is one connection per request
*
Expand Down Expand Up @@ -411,10 +416,10 @@ public boolean pushResource(String path, HttpString method, HeaderMap requestHea
public boolean pushResource(String path, HttpString method, HeaderMap requestHeaders, final HttpHandler handler) {
HeaderMap responseHeaders = new HeaderMap();
try {
requestHeaders.put(Http2ReceiveListener.METHOD, method.toString());
requestHeaders.put(Http2ReceiveListener.PATH, path.toString());
requestHeaders.put(Http2ReceiveListener.AUTHORITY, exchange.getHostAndPort());
requestHeaders.put(Http2ReceiveListener.SCHEME, exchange.getRequestScheme());
requestHeaders.put(METHOD, method.toString());
requestHeaders.put(PATH, path.toString());
requestHeaders.put(AUTHORITY, exchange.getHostAndPort());
requestHeaders.put(SCHEME, exchange.getRequestScheme());

Http2HeadersStreamSinkChannel sink = channel.sendPushPromise(responseChannel.getStreamId(), requestHeaders, responseHeaders);
Http2ServerConnection newConnection = new Http2ServerConnection(channel, sink, getUndertowOptions(), getBufferSize(), rootHandler);
Expand Down

0 comments on commit 818bfe3

Please sign in to comment.