Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kant2002 committed Jul 21, 2023
1 parent ccc2ad7 commit 69d641c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/FSharp.Data.Http/Http.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1558,19 +1558,16 @@ module internal HttpHelpers =
|> Seq.map (fun (MultipartFileItem (formField, fileName, contentType, contentStream)) ->
let printHeader (header, value) = sprintf "%s: %s" header value

let sharedHeaders =
[ prefixedBoundary
HttpRequestHeaders.ContentDisposition("form-data", Some formField, fileName)
|> printHeader ]

let headers =
match contentType with
| Some (contentType) ->
sharedHeaders
|> Seq.append
[ HttpRequestHeaders.ContentType contentType
|> printHeader ]
| None -> sharedHeaders
[ prefixedBoundary
HttpRequestHeaders.ContentDisposition("form-data", Some formField, fileName) |> printHeader
HttpRequestHeaders.ContentType contentType |> printHeader ]
| None ->
[ prefixedBoundary
HttpRequestHeaders.ContentDisposition("form-data", Some formField, fileName)
|> printHeader ]

let headerpart = headers |> String.concat "\r\n"

Expand Down

0 comments on commit 69d641c

Please sign in to comment.