Giter Club home page Giter Club logo

multipart's Introduction

multipart

Build Status

A partial fork of the cgi package exposing the Multipart module.

multipart's People

Contributors

hesselink avatar bergmark avatar peti avatar ali-abrar avatar cgibbard avatar cheecheeo avatar matthewbauer avatar

Stargazers

 avatar  avatar  avatar

Watchers

Sebastiaan Visser avatar  avatar  avatar James Cloos avatar  avatar  avatar  avatar

multipart's Issues

Too strict upper bound on bytestring

The package builds fine with bytestring-0.11.3.1 (shipped with GHC 9.2) as I have tested, but it's upper bound forbids it. It'd be nice if this could be alleviated via a hackage revision!

GHC 8.8.1 can't compile the latest release

It appears that parseM is lacking a MonadFail constraint. See https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail for more details. Unfortunately, that issue is preventing cgi from compiling successfully.

Building library for multipart-0.1.3..
[1 of 2] Compiling Network.Multipart.Header ( Network/Multipart/Header.hs, dist/build/Network/Multipart/Header.o )

Network/Multipart/Header.hs:241:15: error:
    • Could not deduce (MonadFail m) arising from a use of ‘fail’
      from the context: Monad m
        bound by the type signature for:
                   parseM :: forall (m :: * -> *) a.
                             Monad m =>
                             Parser a -> SourceName -> String -> m a
        at Network/Multipart/Header.hs:238:1-60
      Possible fix:
        add (MonadFail m) to the context of
          the type signature for:
            parseM :: forall (m :: * -> *) a.
                      Monad m =>
                      Parser a -> SourceName -> String -> m a
    • In the expression: fail (show e)
      In a case alternative: Left e -> fail (show e)
      In the expression:
        case parse p n inp of
          Left e -> fail (show e)
          Right x -> return x
    |
241 |     Left e -> fail (show e)
    |               ^^^^^^^^^^^^^

Network/Multipart/Header.hs:245:20: error:
    • Could not deduce (MonadFail m) arising from a use of ‘fail’
      from the context: (Monad m, Eq a, Show a)
        bound by the type signature for:
                   lookupM :: forall (m :: * -> *) a b.
                              (Monad m, Eq a, Show a) =>
                              a -> [(a, b)] -> m b
        at Network/Multipart/Header.hs:244:1-57
      Possible fix:
        add (MonadFail m) to the context of
          the type signature for:
            lookupM :: forall (m :: * -> *) a b.
                       (Monad m, Eq a, Show a) =>
                       a -> [(a, b)] -> m b
    • In the first argument of ‘maybe’, namely
        ‘(fail ("No such field: " ++ show n))’
      In the first argument of ‘(.)’, namely
        ‘maybe (fail ("No such field: " ++ show n)) return’
      In the expression:
        maybe (fail ("No such field: " ++ show n)) return . lookup n
    |
245 | lookupM n = maybe (fail ("No such field: " ++ show n)) return . lookup n
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~~~

BUG: v0.1.3 parseMultipartBody fails

GIven the following program

import Network.Multipart
import Data.ByteString.Lazy.UTF8 as BLU

main = let boundary = "---------------------------9051914041544843365972754266" in
    putStr $ show $ parseMultipartBody boundary $ BLU.fromString "-----------------------------9051914041544843365972754266\n\
\Content-Disposition: form-data; name=\"text\"\n\
\\n\
\text default\n\
\-----------------------------9051914041544843365972754266\n\
\Content-Disposition: form-data; name=\"file1\"; filename=\"a.txt\"\n\
\Content-Type: text/plain\n\
\\n\
\Content of a.txt.\n\
\-----------------------------9051914041544843365972754266--"

the output with v0.1.3 is

MultiPart []

Changing multipart to v0.1.2 changes the output to

MultiPart [BodyPart [(HeaderName "Content-Disposition","form-data; name=\"text\"")] "text default",BodyPart [(HeaderName "Content-Disposition","form-data; name=\"file1\"; filename=\"a.txt\""),(HeaderName "Content-Type","text/plain")] "Content of a.txt."]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.