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

HTTP Header Normalizer Middleware #89

Merged
merged 6 commits into from
Jan 17, 2018
Merged

Conversation

lmammino
Copy link
Member

@lmammino lmammino commented Jan 17, 2018

TODO:

  • Increase coverage
  • Documentation

Closes #87

@codecov
Copy link

codecov bot commented Jan 17, 2018

Codecov Report

Merging #89 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #89   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     13    +1     
  Lines         199    221   +22     
  Branches       41     43    +2     
=====================================
+ Hits          199    221   +22
Impacted Files Coverage Δ
src/middlewares/index.js 100% <ø> (ø) ⬆️
src/middlewares/httpHeaderNormalizer.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5ab8b3...b4d2361. Read the comment docs.

## [httpHeaderNormalizer](/src/middlewares/httpHeaderNormalizer.js)

Normalizes HTTP header names to their canonical format. Very useful if clients are
not using the canonical names of header (e.g. `content-type` as opposed to `Content-Type`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we mention middleware adds rawHeaders property?

Copy link
Member Author

Choose a reason for hiding this comment

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

Very good point, i will do that as well

@lmammino
Copy link
Member Author

missing headers from wikipedia:

  • X-ATT-DeviceId
  • X-UIDH

missing from iana.org:

  • ALPN
  • C-PEP
  • C-PEP-Info
  • CalDAV-Timezones
  • Content-ID
  • DASL
  • DAV
  • GetProfile
  • HTTP2-Settings
  • MIME-Version
  • Optional-WWW-Authenticate
  • Sec-WebSocket-Accept
  • Sec-WebSocket-Extensions
  • Sec-WebSocket-Key
  • Sec-WebSocket-Protocol
  • Sec-WebSocket-Version
  • SLUG
  • TTL

Copy link
Contributor

@dkatavic dkatavic left a comment

Choose a reason for hiding this comment

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

Good work @lmammino , as always. Just need to update exception list, as discussed, rest of it is brilliant

@lmammino lmammino merged commit bcd0131 into master Jan 17, 2018
@lmammino lmammino deleted the feature/http-header-normalizer branch January 17, 2018 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants