Skip to content

Feat: Add CORS handling docs, tests and native exports - #385

Merged
AnnaSasDev merged 6 commits into
corefrom
298-feature-registercustomschemehandler-wont-let-do-fetch-and-xmlhttprequest-requests
Aug 3, 2026
Merged

Feat: Add CORS handling docs, tests and native exports#385
AnnaSasDev merged 6 commits into
corefrom
298-feature-registercustomschemehandler-wont-let-do-fetch-and-xmlhttprequest-requests

Conversation

@AnnaSasDev

Copy link
Copy Markdown
Member

Closes #298

Document CORS behavior for custom schemes and add verification tests and native test exports. Adds native test exports (Exports.CustomSchemeResponseTests.cpp) and managed bindings (InfiniFrameNativeTesting.CustomSchemeResponseTests.cs), registers the test source in the native CMakeLists, and introduces multiple tests (managed unit tests, integration Playwright tests) plus cors-test-data.json. Also updates core-window docs and migration notes to describe same-origin CORS behavior and platform specifics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AnnaSasDev and others added 5 commits August 3, 2026 12:43
Replace #if WINDOWS preprocessor marshaling with OperatingSystem.IsWindows() runtime checks in MarshalNativeToString and MarshalStringToNative. Rename FreeNativeString to MarshalFreeNativeString and update all callers to use the new name. Adjust tests to call Marshal.PtrToStringUTF8 for ContentTypeUtf8 and use InfiniFrameNativeTesting.MarshalNativeToString for header strings. This cleans up platform-specific marshaling and avoids the previous preprocessor-based logic.
Replace uses of the local MarshalNativeToString helper with the centralized InfiniFrameNative.PtrToNativeString across tests and remove the duplicate helper from InfiniFrameNativeTesting. Updated files: src/InfiniFrame.NativeBridge/Managed/NativeApi/Testing/InfiniFrameNativeTesting.CustomSchemeResponseTests.cs, tests/InfiniTests.InfiniFrame.NativeBridge/Managed/Delegates/CustomSchemeResponseCorsTests.cs, and tests/InfiniTests.InfiniFrame/Window/Events/CustomSchemeResponseCorsPipelineTests.cs. This unifies native pointer -> string marshalling and avoids duplicated code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AnnaSasDev
AnnaSasDev merged commit 315dd71 into core Aug 3, 2026
55 checks passed
@AnnaSasDev
AnnaSasDev deleted the 298-feature-registercustomschemehandler-wont-let-do-fetch-and-xmlhttprequest-requests branch August 3, 2026 20:03
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.

Feature | RegisterCustomSchemeHandler won't let do fetch and XMLHttpRequest requests

1 participant