aristidb/http-types — Issue #19: encodePathSegments incorrectly prefixes path with /
Author: depp
Created: 2012-03-04 00:02:04+00:00
State: open

The `encodePathSegments` function incorrectly prefixes output with a /. This makes it nearly useless for constructing relative URI references, and this behavior also directly contradicts the documentation.

Test program:

{-# LANGUAGE OverloadedStrings #-}
import Blaze.ByteString.Builder
import Network.HTTP.Types
import Data.Text
main = print . toByteString $ encodePathSegments ["foo", "bar", "baz"]

Expected output (taken directly from the haddock documentation):

"foo/bar/baz"

Actual output:

"/foo/bar/baz"