From aeddd0badcde5ec5150015bc22054e284c2fb8a9 Mon Sep 17 00:00:00 2001 From: Luca Bolognese Date: Thu, 23 Jul 2026 18:34:05 +0200 Subject: [PATCH] Validate hosted native HTTPS Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 523fe3c1-7fe4-4f3e-ad27-0a057a2af4ea --- .gitattributes | 1 + .github/workflows/ci.yml | 7 +- .github/workflows/release.yml | 7 +- README.md | 15 +++-- docs/MANUAL_TESTS.md | 12 ++++ http.osc | 71 ++++++++++++-------- js_bridge.c | 86 ++++++++++++++++++++++-- tests/test_http_request.osc | 89 +++++++++++++++++++++++++ tests/test_posix_net_bridge.sh | 116 +++++++++++++++++++++++++++++++++ tests/test_redirect.osc | 17 +++++ tools/build_common.ps1 | 2 +- tools/smoke_urls.osc | 34 +++++++++- 12 files changed, 413 insertions(+), 44 deletions(-) create mode 100644 .gitattributes create mode 100644 tests/test_http_request.osc create mode 100644 tests/test_posix_net_bridge.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df988f1..a8e4bd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ permissions: contents: read env: - OSCAN_VERSION: 0.0.37 + OSCAN_VERSION: 0.0.39 concurrency: group: ci-${{ github.ref }} @@ -50,6 +50,11 @@ jobs: shell: pwsh run: ./tests/test_build_common.ps1 + - name: POSIX net bridge tests + if: runner.os == 'Linux' + shell: bash + run: bash ./tests/test_posix_net_bridge.sh + - name: Install Oscan shell: bash env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7a1f7e..7628fe5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ permissions: contents: write env: - OSCAN_VERSION: 0.0.37 + OSCAN_VERSION: 0.0.39 jobs: build: @@ -52,6 +52,11 @@ jobs: shell: pwsh run: ./tests/test_build_common.ps1 + - name: POSIX net bridge tests + if: runner.os == 'Linux' + shell: bash + run: bash ./tests/test_posix_net_bridge.sh + - name: Resolve version id: version shell: bash diff --git a/README.md b/README.md index ca0a089..4d8a531 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Switch to a TrueType font (`TT`) and bump the size (`16pt`) for a clean, modern ## Prerequisites -- **[Oscan compiler](https://github.com/lucabol/Oscan)** — required (includes TLS support). Native Windows/Linux builds require Oscan `v0.0.37` or newer with `--backend c|native`, `--native-target`, `--extra-obj`, `--extra-lib`, `--allow-elevated-native-link`, native user-extern `str` parameter/return shims, and native hosted Windows canvas/gfx/clipboard/img/svg/tt runtime support. +- **[Oscan compiler](https://github.com/lucabol/Oscan)** — required (includes TLS support). Native Windows/Linux builds require Oscan `v0.0.39` or newer with `--backend c|native`, `--native-target`, `--extra-obj`, `--extra-lib`, `--allow-elevated-native-link`, native user-extern `str` parameter/return shims, and native hosted Windows/Linux TLS plus Windows canvas/gfx/clipboard/img/svg/tt runtime support. - **PowerShell** — for the build script ## Build backends @@ -382,7 +382,7 @@ supported CSS feature. do one request per socket, but servers that don't send a `Content-Length` and instead stream chunked responses now work) - **TLS built-in** — SChannel on Windows, BearSSL on Linux (zero external dependencies) -- **Redirects** — automatic follow of 301/302/307/308 (up to 5 hops) +- **Redirects** — automatic follow of 301/302/303/307/308 (up to 5 hops) - **Default ports** — 80 for HTTP, 443 for HTTPS - **Persistent HTTP cache** — text responses (HTML, CSS, JS, JSON, XML) survive browser restarts; saved to @@ -433,9 +433,14 @@ Refresh the captured snapshots when sites change layout: .\tools\smoke.ps1 ``` -Hits the public internet to verify the full HTTP→gzip→parse pipeline -end-to-end. Flaky by design; not part of CI. Use after touching -`http.osc`, `gzip_bridge.c`, or TLS-related code. +Hits the public internet to verify HTTPS/TLS, SNI hostname handling, +redirects, `Host` header construction, gzip/chunked/content-length body +handling, and HTML parsing end-to-end, including the lucabol.com regression +URL. Flaky by design; not part of CI. A self-signed local TLS fixture would +require disabling certificate validation or changing host trust stores, so +offline tests keep coverage to deterministic request construction and +response parsing. Use after touching `http.osc`, `gzip_bridge.c`, or +TLS-related code. ## Reader Mode, Bookmarks & Zoom diff --git a/docs/MANUAL_TESTS.md b/docs/MANUAL_TESTS.md index bcf40f6..0074f54 100644 --- a/docs/MANUAL_TESTS.md +++ b/docs/MANUAL_TESTS.md @@ -14,6 +14,18 @@ end-to-end. All can be run against a local Python server Wikipedia streams responses as `Transfer-Encoding: chunked` without `Content-Length`. +## 1a. Native hosted HTTPS smoke + +```powershell +.\tools\smoke.ps1 -Backend native +``` + +**Expect:** the public live-smoke URLs pass, including +`https://www.lucabol.com/posts/2026-03-27-notes-the-metamorphosis-franz-kafka`. +That URL should connect with SNI `www.lucabol.com`, send `Host: +www.lucabol.com`, request the `/posts/...` path, receive a `Content-Length` +response, and render text containing `Gregor`. + ## 2. External `