Skip to content

Commit

Permalink
Rename header splitter constant
Browse files Browse the repository at this point in the history
It's name suggested it's specifically for `X-Trino-Set-Session` only.
  • Loading branch information
findepi committed Feb 23, 2022
1 parent d72b25e commit aeefac6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class StatementClientV1
private static final MediaType MEDIA_TYPE_TEXT = MediaType.parse("text/plain; charset=utf-8");
private static final JsonCodec<QueryResults> QUERY_RESULTS_CODEC = jsonCodec(QueryResults.class);

private static final Splitter SESSION_HEADER_SPLITTER = Splitter.on('=').limit(2).trimResults();
private static final Splitter COLLECTION_HEADER_SPLITTER = Splitter.on('=').limit(2).trimResults();
private static final String USER_AGENT_VALUE = StatementClientV1.class.getSimpleName() +
"/" +
firstNonNull(StatementClientV1.class.getPackage().getImplementationVersion(), "unknown");
Expand Down Expand Up @@ -395,7 +395,7 @@ private void processResponse(Headers headers, QueryResults results)
setPath.set(headers.get(TRINO_HEADERS.responseSetPath()));

for (String setSession : headers.values(TRINO_HEADERS.responseSetSession())) {
List<String> keyValue = SESSION_HEADER_SPLITTER.splitToList(setSession);
List<String> keyValue = COLLECTION_HEADER_SPLITTER.splitToList(setSession);
if (keyValue.size() != 2) {
continue;
}
Expand All @@ -404,15 +404,15 @@ private void processResponse(Headers headers, QueryResults results)
resetSessionProperties.addAll(headers.values(TRINO_HEADERS.responseClearSession()));

for (String setRole : headers.values(TRINO_HEADERS.responseSetRole())) {
List<String> keyValue = SESSION_HEADER_SPLITTER.splitToList(setRole);
List<String> keyValue = COLLECTION_HEADER_SPLITTER.splitToList(setRole);
if (keyValue.size() != 2) {
continue;
}
setRoles.put(keyValue.get(0), ClientSelectedRole.valueOf(urlDecode(keyValue.get(1))));
}

for (String entry : headers.values(TRINO_HEADERS.responseAddedPrepare())) {
List<String> keyValue = SESSION_HEADER_SPLITTER.splitToList(entry);
List<String> keyValue = COLLECTION_HEADER_SPLITTER.splitToList(entry);
if (keyValue.size() != 2) {
continue;
}
Expand Down

0 comments on commit aeefac6

Please sign in to comment.