the x-headers middleware appears to be incompatible with seq header values
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Read ring.middleware.x_headers and ring.middleware.default_charset, starting at the stack-trace locations in x_headers.clj and default_charset.clj. Reproduce the failure with a response header whose value is a sequence, then inspect the existing middleware tests. Done means the supported sequence-valued header no longer raises this exception and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Description
Using a header such as {"content-type" ["text/plain" "text/html"]} in the response will result in the following exception:
[clojure.core$re_matcher invokeStatic core.clj 4667]
[clojure.core$re_find invokeStatic core.clj 4716]
[clojure.core$re_find invoke core.clj 4716]
[ring.middleware.default_charset$text_based_content_type_QMARK_ invokeStatic default_charset.clj 7]
[ring.middleware.default_charset$text_based_content_type_QMARK_ invoke default_charset.clj 6]
[ring.middleware.default_charset$add_charset invokeStatic default_charset.clj 15]
[ring.middleware.default_charset$add_charset invoke default_charset.clj 13]
[ring.middleware.default_charset$wrap_default_charset$fn__12380 invoke default_charset.clj 27]
[ring.middleware.not_modified$wrap_not_modified$fn__12337 invoke not_modified.clj 52]
[ring.middleware.x_headers$wrap_xss_protection$fn__11091 invoke x_headers.clj 71]
[ring.middleware.x_headers$wrap_frame_options$fn__11079 invoke x_headers.clj 38]
[ring.middleware.x_headers$wrap_content_type_options$fn__11085 invoke x_headers.clj 53]
Not sure if this is the expected behavior as the spec states that header values can be seqs.
- Dominant language
- Clojure
- Stars
- 27
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ring-clojure/ring-headers
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in ring-clojure/ring-headers
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
clojure-lsp/clojure-lsp#2469 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
.Team/Metabot Priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100