haskell-servant/servant

servant-client requires charset in Accept PlainText

Open

#1 002 ouverte le 2 juil. 2018

Voir sur GitHub
 (7 commentaires) (1 réaction) (0 assignés)Haskell (422 forks)batch import
enhancementhelp wantednewcomer-friendlyservant-api

Métriques du dépôt

Stars
 (1 953 stars)
Métriques de merge PR
 (Merge moyen 23h 44m) (4 PRs mergées en 30 j)

Description

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?

Guide contributeur