Handle quoted directives in Cache-Control header#216
Handle quoted directives in Cache-Control header#216seanmonstar merged 2 commits intohyperium:masterfrom
Conversation
Cargo.toml
Outdated
| mime = "0.3.14" | ||
| sha1 = "0.10" | ||
| httpdate = "1" | ||
| either = "1.6.0" |
There was a problem hiding this comment.
Instead of pulling in another dependency, I'd prefer if we used a custom enum, or something else local.
There was a problem hiding this comment.
That's what I went with at first locally but it seemed like more trouble than it was worth. either is a relatively small crate and doesn't have any dependencies of its own so it seemed light-weight enough to include. If you're unconvinced I'm happy to write a custom enum.
There was a problem hiding this comment.
Well, before I suggest that, I want to better understand. It seems like the functions/types in util::csv should work, it has tests for quoted strings... If not, should this behavior be limited to only cache-control?
There was a problem hiding this comment.
Oh, I see. It looks like util::csv and util::flat_csv behave differently. I suspect csv should make use of the same quoted handling as flat_csv...
There was a problem hiding this comment.
Easy enough, added quoted block handling to csv parsing.
fc9324e to
bd43f7a
Compare
This fixes a parsing bug that resulted in commas within quoted blocks being treated as delimiters for directives.
The test case added in the first commit demonstrates the issue, and is fixed by the second commit.