Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit d34d475

Browse files
authored
Merge pull request #7 from roccomuso/master
Line break fix + minor typos
2 parents 48d0d53 + 609a450 commit d34d475

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# http-string-parser
22

3+
[![NPM Version](https://img.shields.io/npm/v/http-string-parser.svg)](https://www.npmjs.com/package/http-string-parser)
34
[![Build Status](https://travis-ci.org/apiaryio/http-string-parser.png)](https://travis-ci.org/apiaryio/http-string-parser)
45
[![Dependency Status](https://david-dm.org/apiaryio/http-string-parser.png)](https://david-dm.org/apiaryio/http-string-parser)
56
[![devDependency Status](https://david-dm.org/apiaryio/http-string-parser/dev-status.png)](https://david-dm.org/apiaryio/http-string-parser#info=devDependencies)
67

78
Parse HTTP messages (Request and Response) from raw string in Node.JS
89

9-
##Parse HTTP Messages
10+
## Parse HTTP Messages
1011
```javascript
1112
var parser = require('http-string-parser');
1213

src/parser.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
parseRequest = (requestString) ->
22
request = {}
3-
lines = requestString.split('\r\n')
3+
lines = requestString.split(/\r?\n/)
44

55
parsedRequestLine = parseRequestLine lines.shift()
66
request['method'] = parsedRequestLine['method']
@@ -20,7 +20,7 @@ parseRequest = (requestString) ->
2020

2121
parseResponse = (responseString) ->
2222
response = {}
23-
lines = responseString.split('\r\n')
23+
lines = responseString.split(/\r?\n/)
2424

2525
parsedStatusLine = parseStatusLine lines.shift()
2626
response['protocolVersion'] = parsedStatusLine['protocol']

test/unit/parser-test.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe "parser module", () ->
2323
before () ->
2424
output = parser.parseHeaders headerLines
2525

26-
describe "its retrun", () ->
26+
describe "its return", () ->
2727
it "should be object", () ->
2828
assert.isObject output
2929

0 commit comments

Comments
 (0)