|
1 | 1 | /* |
2 | | - * Copyright 2002-2021 the original author or authors. |
| 2 | + * Copyright 2002-2022 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -77,7 +77,7 @@ public ReactorServerHttpRequest(HttpServerRequest request, NettyDataBufferFactor |
77 | 77 |
|
78 | 78 | private static URI initUri(HttpServerRequest request) throws URISyntaxException { |
79 | 79 | Assert.notNull(request, "HttpServerRequest must not be null"); |
80 | | - return new URI(resolveBaseUrl(request).toString() + resolveRequestUri(request)); |
| 80 | + return new URI(resolveBaseUrl(request) + resolveRequestUri(request)); |
81 | 81 | } |
82 | 82 |
|
83 | 83 | private static URI resolveBaseUrl(HttpServerRequest request) throws URISyntaxException { |
@@ -197,14 +197,26 @@ public <T> T getNativeRequest() { |
197 | 197 | @Override |
198 | 198 | @Nullable |
199 | 199 | protected String initId() { |
| 200 | + if (this.request instanceof Connection) { |
| 201 | + return ((Connection) this.request).channel().id().asShortText() + |
| 202 | + "-" + logPrefixIndex.incrementAndGet(); |
| 203 | + } |
| 204 | + return null; |
| 205 | + } |
| 206 | + |
| 207 | + @Override |
| 208 | + protected String initLogPrefix() { |
200 | 209 | if (reactorNettyRequestChannelOperationsIdPresent) { |
201 | | - return (ChannelOperationsIdHelper.getId(this.request)); |
| 210 | + String id = (ChannelOperationsIdHelper.getId(this.request)); |
| 211 | + if (id != null) { |
| 212 | + return id; |
| 213 | + } |
202 | 214 | } |
203 | 215 | if (this.request instanceof Connection) { |
204 | 216 | return ((Connection) this.request).channel().id().asShortText() + |
205 | 217 | "-" + logPrefixIndex.incrementAndGet(); |
206 | 218 | } |
207 | | - return null; |
| 219 | + return getId(); |
208 | 220 | } |
209 | 221 |
|
210 | 222 |
|
|
0 commit comments