Skip to content

Commit

Permalink
Linux: Range support: get rid of the NSRegularExpression dependency (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c committed Dec 11, 2015
1 parent e46af81 commit 812d50a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Swifter/HttpHandlers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public class HttpHandlers {
return HttpResponse.BadRequest
}

#if os(Linux)
let rangeString = rangeHeader.substringFromIndex(HttpHandlers.rangePrefix.characters.count)
#else
let rangeString = rangeHeader.substringFromIndex(rangeHeader.startIndex.advancedBy(HttpHandlers.rangePrefix.characters.count))
#endif
let rangeStringExploded = rangeString.split("-")
guard rangeStringExploded.count == 2 else {
return HttpResponse.BadRequest
Expand Down

0 comments on commit 812d50a

Please sign in to comment.