@@ -329,7 +329,7 @@ constructQuery = foldMap expandParamList . HashMap.toList
329329getHeader :: HeaderName -> HalRequest. ProxyRequest a -> Maybe ByteString
330330getHeader h =
331331 fmap Text. encodeUtf8
332- . HashMap. lookup (CI. map Text. decodeUtf8 h)
332+ . HashMap. lookup (CI. map Text. decodeUtf8Lenient h)
333333 . HalRequest. headers
334334
335335-- | Convert a WAI 'Wai.Response' into a hal
@@ -369,11 +369,11 @@ readFilePart path mPart = withFile path ReadMode $ \h -> do
369369createProxyBody :: Options -> MediaType -> ByteString -> HalResponse. ProxyBody
370370createProxyBody opts contentType body =
371371 HalResponse. ProxyBody
372- { HalResponse. contentType = Text. decodeUtf8 $ renderHeader contentType,
372+ { HalResponse. contentType = Text. decodeUtf8Lenient $ renderHeader contentType,
373373 HalResponse. serialized =
374374 if isBase64Encoded
375- then Text. decodeUtf8 $ Base64. encode body
376- else Text. decodeUtf8 body,
375+ then Text. decodeUtf8Lenient $ Base64. encode body
376+ else Text. decodeUtf8Lenient body,
377377 HalResponse. isBase64Encoded
378378 }
379379 where
@@ -385,8 +385,8 @@ addHeaders headers response = foldl' addHeader response headers
385385 where
386386 addHeader r (hName, hValue) =
387387 HalResponse. addHeader
388- (Text. decodeUtf8 $ CI. original hName)
389- (Text. decodeUtf8 hValue)
388+ (Text. decodeUtf8Lenient $ CI. original hName)
389+ (Text. decodeUtf8Lenient hValue)
390390 r
391391
392392-- | Try to find the content-type of a response, given the response
0 commit comments