Skip to content

Commit 26698f3

Browse files
committed
fix(transport): validate SSE client through endpoint policy
1 parent 3db2546 commit 26698f3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/main/java/io/github/easy4j/hermes/api/HermesSseClient.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@ public class HermesSseClient implements AutoCloseable {
110110
* @since 1.0.0
111111
*/
112112
public HermesSseClient(HermesHttpClientConfig config, ObjectMapper objectMapper, OkHttpClient httpClient) {
113-
// 与 HermesHttpClient 一致的 host 白名单守卫。
114-
if (!config.isUnsafeBaseUrlOverriddenForTest()) {
115-
io.github.easy4j.hermes.util.EndpointGuard.require(config.getBaseUrl());
116-
}
113+
// 与 HermesHttpClient 一致,构造期按显式策略再次校验。
114+
config.requireBaseUrl();
117115
this.config = Objects.requireNonNull(config, "config");
118116
this.mapper = Objects.isNull(objectMapper) ? new ObjectMapper()
119117
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) : objectMapper;

0 commit comments

Comments
 (0)