Skip to content

Implementation and tests - non seekable multipart form files#1415

Merged
cartermp merged 3 commits intofsprojects:mainfrom
ordinaryorange:Non-seekableMultiparts
Nov 25, 2021
Merged

Implementation and tests - non seekable multipart form files#1415
cartermp merged 3 commits intofsprojects:mainfrom
ordinaryorange:Non-seekableMultiparts

Conversation

@ordinaryorange
Copy link
Copy Markdown
Contributor

Refer #1398

src/Net/Http.fs Outdated
override x.CanSeek = match length with | None -> false | Some _ -> true
override x.CanWrite = false
override x.Length with get () = length
override x.Length with get () = length |> Option.defaultWith (fun () -> NotSupportedException() |> raise)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about a more descriptive message like in Stream? https://docs.microsoft.com/en-us/dotnet/api/system.io.stream.length?view=net-6.0#exceptions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If flipped on this a couple of times. But now rethinking, I reckon a simple failwith "One or more of the encompassed streams are not seekable and the length cannot be determined". We can probably do away with the NotSupportedException type as the CombinedStream is only internal to FSharp.data

Copy link
Copy Markdown
Collaborator

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Will cut a release likely beginning of next week.

@cartermp cartermp merged commit a66b043 into fsprojects:main Nov 25, 2021
@cartermp
Copy link
Copy Markdown
Collaborator

Should be live in NuGet promptly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants