fsprojects / FsHttp

A lightweight F# HTTP library by @SchlenkR and @dawedawe
https://fsprojects.github.io/FsHttp/
Apache License 2.0
424 stars 42 forks source link

.NET 7 not working: "The format of value '' is invalid" #114

Closed drhumlen closed 1 year ago

drhumlen commented 1 year ago

After upgrade to .NET 7, FsHttp seems to struggle with parsing headers:

Unhandled exception. System.AggregateException: One or more errors occurred. (The format of value '' is invalid.)
 ---> System.FormatException: The format of value '' is invalid.
   at System.Net.Http.Headers.HttpHeaderParser.ParseValue(String value, Object storeValue, Int32& index)
   at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(HeaderDescriptor descriptor, HeaderStoreItemInfo info, String value)
   at System.Net.Http.Headers.HttpHeaders.Add(HeaderDescriptor descriptor, String value)

Example for reproduction:

open FsHttp

let req = http {
    GET "http://google.com"
}

let res = Request.send req

printfn $"res = %A{res}"
SchlenkR commented 1 year ago

This is a duplicate of #109 - anyway, thank you @drhumlen for reporting it.

I've released 10.0.0-preview2. See related PR and Commits...

SchlenkR commented 1 year ago

Reopen until non-preview version is released.