- setContentType $ read "text/xml"
- [xmlStr] <- liftIO $ runX ( setErrorMsgHandler False fail
- >>>
- constA (name, cType, bin)
- >>>
- render env
- >>>
- writeDocumentToString [ (a_indent, v_1) ]
- )
- output xmlStr
- where
- guessTypeIfNeeded :: Maybe MIMEType -> Resource MIMEType
- guessTypeIfNeeded (Just t) = return t
- guessTypeIfNeeded Nothing = fail "not impl"
+ let (bin, cType) = case cTypeM of
+ Just (MIMEType "application" "x-rakka-base64-stream" _)
+ -> let b = decodeBase64LBS entity
+ in
+ (b, guessMIMEType b)
+ Just t
+ -> (entity, t)
+ Nothing
+ -> (entity, guessMIMEType entity)