Skip to content

Commit

Permalink
Remove hack introduced in http4s#1202, fixed upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
aeons committed Jun 15, 2017
1 parent c15bfe7 commit 071da02
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions core/src/main/scala/org/http4s/StaticFile.scala
Expand Up @@ -8,13 +8,11 @@ import java.time.Instant
import cats.effect.Sync
import fs2.Stream._
import fs2._
import fs2.interop.scodec.ByteVectorChunk
import fs2.io._
import fs2.io.file.{FileHandle, pulls}
import org.http4s.Status.NotModified
import org.http4s.headers._
import org.log4s.getLogger
import scodec.bits.ByteVector

// TODO: consider using the new scalaz.stream.nio.file operations
object StaticFile {
Expand Down Expand Up @@ -44,10 +42,6 @@ object StaticFile {
Some(Response(
headers = headers,
body = readInputStream[F](F.delay(url.openStream), DefaultBufferSize)
// These chunks wrap a mutable array, and we might be buffering
// or processing them concurrently later. Convert to something
// immutable here for safety.
.mapChunks(c => ByteVectorChunk(ByteVector(c.toArray)))
))
} else Some(Response(NotModified))
}
Expand Down

0 comments on commit 071da02

Please sign in to comment.