libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] issue with multi-part data in libmicrohttpd


From: Conor Lennon
Subject: [libmicrohttpd] issue with multi-part data in libmicrohttpd
Date: Wed, 13 May 2020 14:50:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

I'm having an issue with multi-part data in libmicrohttpd

When the following HTTP request is sent
   

    POST /api/csvrestore HTTP/1.1
    Host: 127.0.0.1
    Authorization: Basic
XXXXXXXXXXXXXXXXXXXX
    User-Agent: PycURL/7.43.0 libcurl/7.43.0 NSS/3.19.1 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.8.0
    Accept: */*
    Content-Type: multipart/form-data; boundary=----------ThIs_Is_ThE_bOuNdArY_$--
    Expect: 100-continue
    Content-Length: 22718

    ------------ThIs_Is_ThE_bOuNdArY_$--
    Content-Disposition: form-data; name="csvfile"; filename="csvconfig.csv"
    Content-Type: text/csv

    MY DATA


what libmicrohttpd is passing up to my application is


    ------------ThIs_Is_ThE_bOuNdArY_$--
    Content-Disposition: form-data; name="csvfile"; filename="csvconfig.csv"
    Content-Type: text/csv

    MY DATA


However, when the following HTTP request is sent

    POST /api/csvrestore HTTP/1.1
    Host: 172.28.2.220
    Authorization: Basic XXXXXXXXXXXXXXXXXXXX
    User-Agent: curl/7.58.0
    Accept: */*
    Content-Length: 22743
    Content-Type: multipart/form-data; boundary=------------------------8ab9ddd6a63717a0
    Expect: 100-continue

    --------------------------8ab9ddd6a63717a0
    Content-Disposition: form-data; name="csvfile"; filename="system.csv"
    Content-Type: application/octet-stream

    MY DATA

I correctly just get "MY DATA" passed up to me by libmicrohttpd.

Is this a known issue, or should I prepare sample code that demonstrates what I have?

I presume the difference that is causing the issue is that when the content-length is after the content-type, there is a problem.

Regards,

Conor


reply via email to

[Prev in Thread] Current Thread [Next in Thread]