Support {} in url query parameters
This commit is contained in:
@@ -401,7 +401,8 @@ public class ApiConfigService implements ApplicationListener<ContextRefreshedEve
|
|||||||
}
|
}
|
||||||
if (clientCanAccess.isEmpty()) {
|
if (clientCanAccess.isEmpty()) {
|
||||||
StringBuilder b = ThreadContext.getStringBuilder();
|
StringBuilder b = ThreadContext.getStringBuilder();
|
||||||
b.append("app ").append(app).append(" can't access ").append(JacksonUtils.writeValueAsString(apiConfigs));
|
// b.append("app ").append(app).append(" can't access ").append(JacksonUtils.writeValueAsString(apiConfigs));
|
||||||
|
b.append("app ").append(app).append(" can't access matching route");
|
||||||
return Result.fail(b.toString());
|
return Result.fail(b.toString());
|
||||||
}
|
}
|
||||||
ApiConfig bestOne = clientCanAccess.get(0);
|
ApiConfig bestOne = clientCanAccess.get(0);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package we.proxy;
|
package we.proxy;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -73,12 +74,24 @@ public class FizzWebClient {
|
|||||||
@Resource(name = ProxyWebClientConfig.proxyWebClient)
|
@Resource(name = ProxyWebClientConfig.proxyWebClient)
|
||||||
private WebClient webClient;
|
private WebClient webClient;
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send(String traceId,
|
||||||
|
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body) {
|
||||||
|
|
||||||
|
return send(traceId, method, uriOrSvc, headers, body, ArrayUtils.EMPTY_STRING_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send(String traceId,
|
public Mono<ClientResponse> send(String traceId,
|
||||||
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body, String... uriQryParamVals) {
|
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body, String... uriQryParamVals) {
|
||||||
|
|
||||||
return send(traceId, method, uriOrSvc, headers, body, 0, 0, 0, uriQryParamVals);
|
return send(traceId, method, uriOrSvc, headers, body, 0, 0, 0, uriQryParamVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send(String traceId,
|
||||||
|
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
|
long timeout, long numRetries, long retryInterval) {
|
||||||
|
return send(traceId, method, uriOrSvc, headers, body, timeout, numRetries, retryInterval, ArrayUtils.EMPTY_STRING_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send(String traceId,
|
public Mono<ClientResponse> send(String traceId,
|
||||||
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body,
|
HttpMethod method, String uriOrSvc, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
long timeout, long numRetries, long retryInterval, String... uriQryParamVals) {
|
long timeout, long numRetries, long retryInterval, String... uriQryParamVals) {
|
||||||
@@ -124,6 +137,12 @@ public class FizzWebClient {
|
|||||||
return cr;
|
return cr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
||||||
|
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body) {
|
||||||
|
|
||||||
|
return send2service(traceId, method, service, relativeUri, headers, body, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
||||||
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body,
|
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
String... relativeUriQryParamVals) {
|
String... relativeUriQryParamVals) {
|
||||||
@@ -131,6 +150,13 @@ public class FizzWebClient {
|
|||||||
return send2service(traceId, method, service, relativeUri, headers, body, 0, 0, 0, relativeUriQryParamVals);
|
return send2service(traceId, method, service, relativeUri, headers, body, 0, 0, 0, relativeUriQryParamVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
||||||
|
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
|
long timeout, long numRetries, long retryInterval) {
|
||||||
|
|
||||||
|
return send2service(traceId, method, service, relativeUri, headers, body, timeout, numRetries, retryInterval, ArrayUtils.EMPTY_STRING_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
public Mono<ClientResponse> send2service(@Nullable String traceId,
|
||||||
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body,
|
HttpMethod method, String service, String relativeUri, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
long timeout, long numRetries, long retryInterval, String... relativeUriQryParamVals) {
|
long timeout, long numRetries, long retryInterval, String... relativeUriQryParamVals) {
|
||||||
@@ -168,10 +194,20 @@ public class FizzWebClient {
|
|||||||
return cr;
|
return cr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send2uri(@Nullable String traceId, HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body) {
|
||||||
|
return send2uri(traceId, method, uri, headers, body, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send2uri(@Nullable String traceId, HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body, String... uriQryParamVals) {
|
public Mono<ClientResponse> send2uri(@Nullable String traceId, HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body, String... uriQryParamVals) {
|
||||||
return send2uri(traceId, method, uri, headers, body, 0, uriQryParamVals);
|
return send2uri(traceId, method, uri, headers, body, 0, uriQryParamVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mono<ClientResponse> send2uri(@Nullable String traceId,
|
||||||
|
HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
|
long timeout) {
|
||||||
|
return send2uri(traceId, method, uri, headers, body, timeout, ArrayUtils.EMPTY_STRING_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
public Mono<ClientResponse> send2uri(@Nullable String traceId,
|
public Mono<ClientResponse> send2uri(@Nullable String traceId,
|
||||||
HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body,
|
HttpMethod method, String uri, @Nullable HttpHeaders headers, @Nullable Object body,
|
||||||
long timeout, String... uriQryParamVals) {
|
long timeout, String... uriQryParamVals) {
|
||||||
|
|||||||
Reference in New Issue
Block a user