Skip to content

Commit

Permalink
Merge pull request #4 from vapor/off-by-one-fix
Browse files Browse the repository at this point in the history
off by one fix
  • Loading branch information
tanner0101 authored Mar 6, 2017
2 parents 2ea24e5 + 3262755 commit 1725590
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Multipart/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ public final class Parser {

let raw = Array(buffer[0..<bodyEndIndex])
let body = Array(raw.trimmed([.newLine, .carriageReturn]))

let pos = bodyEndIndex + boundarySize

// newline
let pos = bodyEndIndex + boundarySize + 1
if pos > buffer.count {
buffer = []
} else {
Expand Down

0 comments on commit 1725590

Please sign in to comment.