Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Response headers regex #34
Conversation
A little refactoring and semantic, related to `const, let` and right scope of values.
fixed with previous hook `no-cond-assign`, what is not good. In future will propose better.
| return new Promise( (resolve, reject) => { | ||
| let request = new XMLHttpRequest(); | ||
| return new Promise((resolve, reject) => { | ||
| const response = () => { |
developit
Mar 12, 2017
Owner
probably best to leave this as a function declaration so the name doesn't get duplicated.
probably best to leave this as a function declaration so the name doesn't get duplicated.
|
I sort-of wish the regex and refactor changes were in separate PRs |
|
@developit disagree, check the new commit with current syntax – I saved 1 byte, |
…aders don't need it."
|
@developit any issues about PR? |
|
Ahh no, sorry, I just let this slip. I had meant to do some browser testing. |
|
Any status? |
Optimized regex for retrieving headers pair.
Saved bytes: 7.
But we can save 1 byte more, if we will consider on next situation.
Do we have real case when
getAllResponseHeadersreturns not strict format of pair?Example:
X-Foo: bar\nX-Foo:baz