haskell-servant/servant

servant-client requires charset in Accept PlainText

Open

#1,002 建立於 2018年7月2日

在 GitHub 查看
 (7 留言) (1 反應) (0 負責人)Haskell (422 fork)batch import
enhancementhelp wantednewcomer-friendlyservant-api

倉庫指標

Star
 (1,953 star)
PR 合併指標
 (平均合併 5小時 49分鐘) (30 天內合併 2 個 PR)

描述

The current implementation is

instance Accept PlainText where
    contentType _ = "text" M.// "plain" M./: ("charset", "utf-8")

Trying to parse text/plain yields UnsupportedContentType text/plain

One API I'm calling does not specify the charset so I can't use PlainText, but this does the job:

data PT
instance Accept PT where
  contentType _ = "text" M.// "plain"

The workaround is simple, but could/should the charset be made optional?

貢獻者指南