An open API service indexing awesome lists of open source software.

https://github.com/marcbachmann/warning-header-parser


https://github.com/marcbachmann/warning-header-parser

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# warning-header-parser

[![Greenkeeper badge](https://badges.greenkeeper.io/marcbachmann/warning-header-parser.svg)](https://greenkeeper.io/)

Parses an http `Warning` header. https://tools.ietf.org/html/rfc7234#section-5.5

```javascript
var parse = require('warning-header-parser')
parse('199 agent "Error message" "2015-01-01"')
// returns
[{
code: '199',
agent: 'agent',
message: 'Error message',
date: '2015-01-01'
}]

// Supports comma delimited warnings
parse('199 agent "Error message" "2015", 299 agent2 "Error message 2 with \" quote" "2016"')
```