Skip to content

Commit

Permalink
fix multipart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jun 25, 2024
1 parent 054cfc5 commit 45662d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/response.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ let copy_file ?version ?(headers = Headers.empty) path =
with
| exn -> Result.error (`Exn exn)
in

let headers =
let mime = Magic_mime.lookup path in
Headers.(add_unless_exists headers Well_known.content_type mime)
Expand Down
11 changes: 4 additions & 7 deletions multipart_test/multipart_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ let content_type =
"multipart/form-data; boundary=----WebKitFormBoundaryVuTaDGWRcduyfmAv"

let multipart_request_body n =
Format.asprintf
{|------WebKitFormBoundaryVuTaDGWRcduyfmAv
Content-Disposition: form-data; name="picture.png"; filename="picture.png"
Content-Type: image/png

%s
{|------WebKitFormBoundaryVuTaDGWRcduyfmAv|}^"\r"^{|
Content-Disposition: form-data; name="picture.png"; filename="picture.png"|}^"\r"^{|
Content-Type: image/png|}^"\r\n\r\n"^
(String.make n 'a')^"\r"^{|
------WebKitFormBoundaryVuTaDGWRcduyfmAv--
|}
(String.make n 'a')

let multipart_request_body_chunks payload =
let continue = ref true in
Expand Down

0 comments on commit 45662d9

Please sign in to comment.