Skip to content

Commit 6fa93c8

Browse files
committed
Latin1 default to UTF8 default
1 parent 52bb2d4 commit 6fa93c8

File tree

8 files changed

+22
-19
lines changed

8 files changed

+22
-19
lines changed

HttpFs.IntegrationTests/AssemblyInfo.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ open System.Reflection
66
[<assembly: AssemblyProductAttribute("HttpFs.IntegrationTests")>]
77
[<assembly: AssemblyCopyrightAttribute("Copyright © 2018")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.2.1")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.2.1")>]
9+
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs.IntegrationTests"
1515
let [<Literal>] AssemblyProduct = "HttpFs.IntegrationTests"
1616
let [<Literal>] AssemblyCopyright = "Copyright © 2018"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.2.1"
19-
let [<Literal>] AssemblyFileVersion = "5.2.1"
18+
let [<Literal>] AssemblyVersion = "5.3.0"
19+
let [<Literal>] AssemblyFileVersion = "5.3.0"

HttpFs.IntegrationTests/HttpServer.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ let app =
5252
Filters.path "/MoonLanguageTextPlainNoEncoding"
5353
>=> Writers.setHeader "Content-Type" "text/plain"
5454
>=> warbler (fun _ ->
55-
Encoding.GetEncoding("windows-1251").GetBytes("яЏ§§їДЙ")
55+
Encoding.UTF8.GetBytes("яЏ§§їДЙ")
5656
|> Successful.ok)
5757

5858
Filters.path "/MoonLanguageApplicationXmlNoEncoding"
5959
>=> Writers.setHeader "Content-Type" "application/xml"
6060
>=> warbler (fun _ ->
61-
Encoding.GetEncoding("windows-1251").GetBytes("яЏ§§їДЙ")
61+
Encoding.UTF8.GetBytes("яЏ§§їДЙ")
6262
|> Successful.ok)
6363

6464
Filters.path "/MoonLanguageInvalidEncoding"
6565
>=> Writers.setHeader "Content-Type" "text/plain; charset=Ninky-Nonk"
6666
>=> warbler (fun _ ->
67-
Encoding.GetEncoding("windows-1251").GetBytes("яЏ§§їДЙ")
67+
Encoding.UTF8.GetBytes("яЏ§§їДЙ")
6868
|> Successful.ok)
6969

7070
Filters.path "/utf8"

HttpFs.IntegrationTests/Tests.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ let tests =
294294
Expect.equal responseBodyString "яЏ§§їДЙ" "body should be equal"
295295
}
296296

297-
testCaseAsync "response charset IS NOT SPECIFIED, NO Content-Type header, body read by default as Latin 1" <| async {
298-
let expected = "ÿ§§¿ÄÉ" // "яЏ§§їДЙ" (as encoded with windows-1251) decoded with ISO-8859-1 (Latin 1)
297+
testCaseAsync "response charset IS NOT SPECIFIED, NO Content-Type header, body read by default as UTF8" <| async {
298+
let expected = "яЏ§§їДЙ"
299299

300300
let! response =
301301
Request.create Get (uriFor "/MoonLanguageTextPlainNoEncoding")

HttpFs.UnitTests/AssemblyInfo.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ open System.Reflection
66
[<assembly: AssemblyProductAttribute("HttpFs.UnitTests")>]
77
[<assembly: AssemblyCopyrightAttribute("Copyright © 2018")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.2.1")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.2.1")>]
9+
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs.UnitTests"
1515
let [<Literal>] AssemblyProduct = "HttpFs.UnitTests"
1616
let [<Literal>] AssemblyCopyright = "Copyright © 2018"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.2.1"
19-
let [<Literal>] AssemblyFileVersion = "5.2.1"
18+
let [<Literal>] AssemblyVersion = "5.3.0"
19+
let [<Literal>] AssemblyFileVersion = "5.3.0"

HttpFs/AssemblyInfo.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ open System.Reflection
66
[<assembly: AssemblyProductAttribute("HttpFs")>]
77
[<assembly: AssemblyCopyrightAttribute("Copyright © 2018")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.2.1")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.2.1")>]
9+
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs"
1515
let [<Literal>] AssemblyProduct = "HttpFs"
1616
let [<Literal>] AssemblyCopyright = "Copyright © 2018"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.2.1"
19-
let [<Literal>] AssemblyFileVersion = "5.2.1"
18+
let [<Literal>] AssemblyVersion = "5.3.0"
19+
let [<Literal>] AssemblyFileVersion = "5.3.0"

HttpFs/HttpFs.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ module Client =
10031003
| None ->
10041004
match response.characterSet with
10051005
| None ->
1006-
ISOLatin1 // TODO: change to UTF-8
1006+
Encoding.UTF8
10071007
| Some responseCharset ->
10081008
try Encoding.GetEncoding(mapEncoding responseCharset)
10091009
with _ -> Encoding.UTF8

HttpFs/HttpFs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>HttpFs</AssemblyName>
55
<PackageId>Http.fs</PackageId>
6-
<Version>5.2.1</Version>
6+
<Version>5.3.0</Version>
77
<TargetFrameworks>netstandard2.0;net471</TargetFrameworks>
88
</PropertyGroup>
99
<ItemGroup>

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 5.3.0 — 2018-06-27
2+
* Default non-specified charsets to UTF8 rather than Latin 1.
3+
14
#### 5.2.1 — 2018-06-07
25
* Allow adding Authorization header without HttpClient validating it.
36

0 commit comments

Comments
 (0)