You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/02/19 23:30:09 UTC

[GitHub] [trafficserver] ywkaras commented on a change in pull request #7545: For TSHttpHdrEffectiveUrlBufGet(), include scheme for request to server URL.

ywkaras commented on a change in pull request #7545:
URL: https://github.com/apache/trafficserver/pull/7545#discussion_r579536900



##########
File path: proxy/hdrs/URL.cc
##########
@@ -1588,10 +1594,33 @@ url_print(URLImpl *url, char *buf_start, int buf_length, int *buf_index_inout, i
   if (!x)      \
   return 0
 
+  enum { OTHER, FILE, NONE } scheme_added = OTHER;
   if (url->m_ptr_scheme) {
-    TRY((normalize ? mime_mem_print_lc : mime_mem_print)(url->m_ptr_scheme, url->m_len_scheme, buf_start, buf_length,
-                                                         buf_index_inout, buf_chars_to_skip_inout));
-    TRY(mime_mem_print("://", 3, buf_start, buf_length, buf_index_inout, buf_chars_to_skip_inout));
+    if ((url->m_scheme_wks_idx >= 0) && (hdrtoken_index_to_wks(url->m_scheme_wks_idx) == URL_SCHEME_FILE)) {
+      TRY(mime_mem_print(URL_SCHEME_FILE, URL_LEN_FILE, buf_start, buf_length, buf_index_inout, buf_chars_to_skip_inout));
+      scheme_added = FILE;

Review comment:
       As a bit of unrelated cleanup, allow for "file" scheme, since url_length_get() allows for it.




----------------------------------------------------------------
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.

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