You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mkmik (via GitHub)" <gi...@apache.org> on 2023/05/24 16:15:00 UTC

[GitHub] [arrow-rs] mkmik commented on a diff in pull request #4271: Strip leading whitespace from flight_sql_client custom header values

mkmik commented on code in PR #4271:
URL: https://github.com/apache/arrow-rs/pull/4271#discussion_r1204462482


##########
arrow-flight/src/bin/flight_sql_client.rs:
##########
@@ -49,7 +49,7 @@ where
         match parts.as_slice() {
             [key, value] => {
                 let key = K::from_str(key).map_err(|e| e.to_string())?;
-                let value = V::from_str(value).map_err(|e| e.to_string())?;
+                let value = V::from_str(value.trim_start()).map_err(|e| e.to_string())?;

Review Comment:
   Yeah I thought only leading whitespace was trimmed in HTTP/1.1 (upon which the CLI tools like curl are modelled on), but it turns out that trailing whitespace is optioinal too:
   
   https://www.rfc-editor.org/rfc/rfc7230#appendix-B
   
   ```
   OWS = *( SP / HTAB )
   header-field  = field-name ":" OWS field-value OWS
   field-value   = *( field-content / obs-fold )
   field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
   field-vchar   = VCHAR / obs-text
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org