Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed HTTP header naming

  • Loading branch information...
commit b1ee4ab8d9b547080ba166ddc782f9e6476c56eb 1 parent 01b5786
@niclashoyer authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/Accept.coffee
View
16 src/Accept.coffee
@@ -93,13 +93,13 @@ sortMediaType = (a, b) ->
# Build middleware with parsers for several accept header fields.
middleware = (req, res, next) ->
- req.types = parseAccept req.headers.accept
- req.charsets = parseHeaderField req.headers['accept-charsets']
- req.encodings = parseHeaderField req.headers['accept-encodings']
- req.languages = parseHeaderField req.headers['accept-language']
- req.ranges = parseHeaderField req.headers['accept-ranges']
+ req.accept =
+ types: parseAccept req.headers.accept
+ charsets: parseHeaderField req.headers['accept-charset']
+ encodings: parseHeaderField req.headers['accept-encoding']
+ languages: parseHeaderField req.headers['accept-language']
+ ranges: parseHeaderField req.headers['accept-ranges']
next()
-module.exports =
- accept: middleware
- parser: parseHeaderField
+module.exports = middleware
+module.exports.parser = parseHeaderField
Please sign in to comment.
Something went wrong with that request. Please try again.