Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Handle header names in a case-insensitive manner when metadata is ret… #13887

Merged
merged 5 commits into from Mar 15, 2018

Conversation

eshienbrood
Copy link
Contributor

…urned in the line-delimited JSON HTML format.

This affects SRA, and matches the behavior of the non-SRA case, when metadata is returned in actual HTTP response headers.

@@ -72,9 +72,15 @@ export function metaJsonCreativeGrouper(callback) {
let first;
return function(line, done) {
if (first) {
const metadata =
/** @type {!Object<string, *>} */(tryParseJson(first) || {});
const m = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive name than m, please

@eshienbrood
Copy link
Contributor Author

Addressed review feedback. Thanks for the suggestion about Array.reduce!

@eshienbrood
Copy link
Contributor Author

All tests have now passed. Please merge.

@keithwrightbos keithwrightbos merged commit 8782fb8 into ampproject:master Mar 15, 2018
@eshienbrood eshienbrood deleted the headers branch March 28, 2018 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants