Skip to content

Implemented CORS mechanism#2423

Draft
maifeeulasad wants to merge 9 commits into
lightpanda-io:mainfrom
maifeeulasad:feat-cors-maifee
Draft

Implemented CORS mechanism#2423
maifeeulasad wants to merge 9 commits into
lightpanda-io:mainfrom
maifeeulasad:feat-cors-maifee

Conversation

@maifeeulasad
Copy link
Copy Markdown

closes #2015

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@maifeeulasad
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@maifeeulasad maifeeulasad marked this pull request as draft May 11, 2026 17:12
Co-authored-by: Copilot <copilot@github.com>
@maifeeulasad maifeeulasad marked this pull request as ready for review May 11, 2026 20:44
@maifeeulasad
Copy link
Copy Markdown
Author

When I ran the v8 in debug mode locally I had no issues. It passed. Here is the exact command.

ZIG_V8_VERSION=v0.4.4                                                            
V8_VERSION=14.0.365.4
OS=linux
ARCH=x86_64
CACHE_DIR=~/.cache

mkdir -p "$CACHE_DIR/v8" v8
wget -O "$CACHE_DIR/v8/libc_v8.a" \
  "https://github.com/lightpanda-io/zig-v8-fork/releases/download/${ZIG_V8_VERSION}/libc_v8_${V8_VERSION}_${OS}_${ARCH}_debug.a"
ln -sf "$CACHE_DIR/v8/libc_v8.a" v8/libc_v8_debug.a

zig build -Dprebuilt_v8_path=~/.cache/v8/libc_v8.a -Dtsan=true test

And regarding demo runner I am bit confused now! Care to guide me please? So that we can get this done!

cc: @krichprollsch

@krichprollsch
Copy link
Copy Markdown
Member

@maifeeulasad no worries, we have flaky tests. I will re-start them, not a blocker for review.

@maifeeulasad
Copy link
Copy Markdown
Author

@krichprollsch eagerly waiting for reviews and open for change requests.

Comment thread src/network/Cors.zig
}

/// Validate response headers for client-side CORS checks
pub fn isResponseAllowed(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong, but it seems only isReponseAllowed is used from Cors.zig, other functions are deadcode?

$ ag "Cors\." src/
src/browser/webapi/net/Fetch.zig
22:const Cors = @import("../../../network/Cors.zig");
211:        if (!Cors.isResponseAllowed(allow_origin, allow_credentials, requesting_origin.?, self._allow_credentials)) {

src/browser/webapi/net/XMLHttpRequest.zig
25:const Cors = @import("../../../network/Cors.zig");
508:        if (!Cors.isResponseAllowed(allow_origin, allow_credentials, request_origin.?, self._with_credentials)) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing this. Give me a week.

@maifeeulasad maifeeulasad marked this pull request as draft May 17, 2026 12:50
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.

Implement CORS mechanism

2 participants