Replace non-ascii characters in headers to be in line with the service. (#292)
* Replace non-ascii characters in headers to be in line with the service. * Use a more concise method
This commit is contained in:
Родитель
9540e93da3
Коммит
e478801857
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
* Replace non-ascii characters in headers to be in line with the service.
|
||||
### Security
|
||||
* No redirects by default
|
||||
|
||||
|
|
|
@ -307,6 +307,8 @@ class ClientImpl implements Client, StreamingClient {
|
|||
activityId, activityId, activityId, clientRequestId);
|
||||
headers.put("x-ms-activitycontext", activityContext);
|
||||
|
||||
// replace non-ascii characters in header values with '?'
|
||||
headers.replaceAll((_i, v) -> v == null ? null : v.replaceAll("[^\\x00-\\x7F]", "?"));
|
||||
return headers;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,7 @@ class E2ETest {
|
|||
|
||||
ConnectionStringBuilder engineCsb = ConnectionStringBuilder.createWithAadApplicationCredentials(System.getenv("ENGINE_CONNECTION_STRING"), appId,
|
||||
appKey, tenantId);
|
||||
engineCsb.setUserNameForTracing("Java_E2ETest_ø");
|
||||
try {
|
||||
streamingIngestClient = IngestClientFactory.createStreamingIngestClient(engineCsb);
|
||||
queryClient = ClientFactory.createClient(engineCsb);
|
||||
|
|
Загрузка…
Ссылка в новой задаче