You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "afedulov (via GitHub)" <gi...@apache.org> on 2023/07/05 09:24:09 UTC
[GitHub] [flink] afedulov commented on a diff in pull request #22816: [FLINK-32373][sql-client] Support passing headers with SQL Client gateway requests
afedulov commented on code in PR #22816:
URL: https://github.com/apache/flink/pull/22816#discussion_r1252816515
##########
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/ExecutorImpl.java:
##########
@@ -577,4 +593,29 @@ private void closeSession() throws SqlExecutionException {
// ignore any throwable to keep the cleanup running
}
}
+
+ private static Collection<HttpHeader> readHeadersFromEnvironmentVariable(String envVarName) {
+ List<HttpHeader> headers = new ArrayList<>();
+ String rawHeaders = System.getenv(envVarName);
+
+ if (rawHeaders != null) {
+ String[] lines = rawHeaders.split("\n");
Review Comment:
I believe this is actually the best option because, as RFC 7230 states, CRLF within header values was only expected as part of "obsolete folding", which [is not supported anymore](https://datatracker.ietf.org/doc/html/rfc7230#:~:text=Historically%2C%20HTTP%20header%20field%20values%20could%20be%20extended%20over%0A%20%20%20multiple%20lines).
```
header-field = field-name ":" OWS field-value OWS
field-name = token
field-value = *( field-content / obs-fold )
field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
field-vchar = VCHAR / obs-text
obs-fold = CRLF 1*( SP / HTAB )
; obsolete line folding
; see [Section 3.2.4](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4)
```
field-value, on the other hand rules out anything in VCHAR, so expecting a delimiter and an escaping strategy for a character that can naturally occur in a cookie is not user-friendly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org