Repository navigation
fix: get through the site's firewall, and serialize without reflection - #6
Merged
Merged
Conversation
The first live run against the test site found SiteGround's firewall refusing the first TLS handshake .NET's managed handler makes per process, and its proxy dropping If-None-Match; and the client threw where reflection-based JSON is off (file-based apps, trimmed/AOT builds). Retries a firewall's HTML 403 on a fresh connection, sends a User-Agent, uses AndroidMessageHandler under UseFreedom, sends the ETag as ?etag= too, and source-generates all JSON with FreedomStateJson for stores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by the first real run against the test site (
https://aa-bristol.org/amber), after Freedom 0.1.0 was deployed there.SiteGround's firewall refuses the first TLS handshake that .NET's managed handler makes in a process with an HTML 403. Later connections resume the session and pass.
The fix:
Connection: close). Otherwise the retry reuses the refused connection and is refused again.UseFreedomsends throughAndroidMessageHandler, as Link does.User-Agent. UnderUseFreedomit starts with the app's own name and version.The proxy also drops
If-None-Match, so the manifest request sends the ETag as?etag=too. The plugin side is in bleedingdeacons/freedom.JSON is source-generated. A .NET 10 file-based app threw "Reflection-based serialization has been disabled" on its first request, and trimmed or AOT builds would too.
FreedomStateJsonnow serves the MAUI stores and the example CLI.End to end against the test site, with the library's default client and a code minted server-side (Google sign-in needs a person):
smtp.host v1,smtp.password v2 secret80 tests and 34 scenarios pass; formatting is clean; the MAUI adapter builds for Android.