Closed brucejo75 closed 5 months ago
Describe the bug .["Cache-Control"] works .resp_header.["Cache-Control"] does not work
.["Cache-Control"]
.resp_header.["Cache-Control"]
To Reproduce See https://jqplay.org/s/EhUZ6-UcIae
Expected Output
{ "Cache-Control": [ "max-age=2592000; public;" ], "C-CA": [ "max-age=2592000; public;" ], "C-CB": [ "max-age=2592000; public;" ], "resp_headers": { "Cache-Control:": [ "max-age=2592000; public;" ] }, "C-C2A": [ "max-age=2592000; public;" ], "C-C2B": [ "max-age=2592000; public;" ] }
Environment (please complete the following information):
jq@1.7.1
Additional context Related #38
D'oh field was "Cache-Control:" not "Cache-Control". jq works fine.
Closing
Describe the bug
.["Cache-Control"]
works.resp_header.["Cache-Control"]
does not workTo Reproduce See https://jqplay.org/s/EhUZ6-UcIae
Data for repro (also available in `jq play`)
json input: ```json { "resp_headers": { "Cache-Control:": ["max-age=2592000; public;"] }, "Cache-Control": ["max-age=2592000; public;"] } ``` jq filter: ```jq { "Cache-Control": .resp_headers.["Cache-Control"], "C-CA": .resp_headers["Cache-Control"], "C-CB": .resp_headers."Cache-Control", "resp_headers": .resp_headers, "C-C2A": .["Cache-Control"], "C-C2B": ."Cache-Control" } ``` result: ```json { "Cache-Control": null, "C-CA": null, "C-CB": null, "resp_headers": { "Cache-Control:": [ "max-age=2592000; public;" ] }, "C-C2A": [ "max-age=2592000; public;" ], "C-C2B": [ "max-age=2592000; public;" ] } ```Expected Output
Environment (please complete the following information):
jq@1.7.1
Additional context Related #38