[
https://issues.apache.org/jira/browse/TS-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15225674#comment-15225674
]
ASF GitHub Bot commented on TS-4312:
------------------------------------
Github user jpeach commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/541#discussion_r58485657
--- Diff: proxy/hdrs/URL.cc ---
@@ -1158,9 +1158,51 @@ url_parse_scheme(HdrHeap *heap, URLImpl *url, const
char **start, const char *en
return PARSE_ERROR; // no non-whitespace found
}
+static bool
+url_init_non_encoded_char_array(char *non_encoded_char, size_t size)
+{
+ const char *allowed_char = ":/?#[]@" // gen-delims
+ "!$&'()*+,;=" // sub-delims
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // ALPHA
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789" // DIGIT
+ "-._~" // other
unreserved
+ "%"; // '%' should
also not be encoded
+
+ memset(non_encoded_char, 0, size);
+ for (size_t i = 0; i < strlen(allowed_char); ++i) {
+ ink_assert((unsigned char)allowed_char[i] < size);
+ non_encoded_char[(unsigned char)allowed_char[i]] = 1;
+ }
+
+ return true;
+}
+
+static char non_encoded_char[256];
+static bool url_init_non_encoded_char_array_done =
url_init_non_encoded_char_array(non_encoded_char, sizeof(non_encoded_char));
--- End diff --
Yes I see your point. I think that this properly belongs in
[ParseRules.cc](https://github.com/apache/trafficserver/blob/master/lib/ts/ParseRules.cc),
though all the parse bits are taken. Maybe we could reclaim something esoteric
like ``is_wildmat_BIT``?
> Adding config to parse urls according to RFC
> --------------------------------------------
>
> Key: TS-4312
> URL: https://issues.apache.org/jira/browse/TS-4312
> Project: Traffic Server
> Issue Type: Bug
> Reporter: Shen Zhang
> Assignee: Brian Geffon
> Fix For: 6.2.0
>
>
> Adding a config option "proxy.config.http.strict_uri_parsing" to sends http
> status code 400 back to client if the URL includes non-RFC 3986 compliant
> character
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)