Skip to content

Conversation

@GerardSmit
Copy link

This PR changes the JSON parsing to System.Text.Json instead of Newtonsoft.Json.

Also changed that the HttpClient is being managed by IHttpClientFactory (when used in DI).
Currently we're creating a HttpClient every request. While the following post is from 2016 and maybe improved in .NET, it's still bad practice: https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
A singleton HttpClient is better but will fail if proxycheck.io changes their DNS.

Also, I enabled nullable so I'm sure that I didn't miss any null checks, and trimming for AOT cuz why not.

The project has now 0 warnings. 🔥

@GerardSmit GerardSmit force-pushed the feature/system-text-json branch 2 times, most recently from b6d883c to e9b1049 Compare January 2, 2025 20:37
@GerardSmit GerardSmit force-pushed the feature/system-text-json branch from e9b1049 to 91754bd Compare January 2, 2025 20:55
@velddev velddev merged commit aadadaa into top-gg:master Jan 2, 2025
1 check passed
@velddev
Copy link

velddev commented Jan 2, 2025

Thank you kind sir 👍

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