• v0.1.0-dev.21 4f99d70969

    v0.1.0-dev.21 Pre-release

    john released this 2026-11-11 23:39:19 +00:00 | 176 commits to main since this release

    v0.1.0-dev.21 — Configurable REST CORS for browser tools (pre-release)

    Fixes Open WebUI personal/direct connections failing on OPTIONS preflight while
    server-side schema GETs work. The browser origin must be explicitly configured.

    • New CORN_ALLOWED_ORIGINS environment variable: comma-separated exact HTTP(S)
      origins, default empty (REST CORS disabled). Reject wildcard/null/path/query/userinfo
      values; normalize host case, default ports and trailing root slash. Maximum 32 origins.
    • Scope CORS to JSON/YAML discovery and /api/v1/ tool APIs, excluding API-key
      lifecycle and console session routes. UI/login and existing MCP handling unchanged.
    • Allow Authorization/Content-Type and GET/HEAD/POST/PUT/DELETE/OPTIONS; no wildcard
      origin, cross-origin credentialed cookies or X-Corn-Console header allowance.
    • Wrap the complete application at the API boundary, including 401 and unhandled
      500 responses, so real errors remain readable instead of browser network errors.
    • Production Compose example includes an empty inline setting. Development .env
      example documents it. Existing private Compose files are not overwritten.

    Existing Compose update

    Add this to your existing x-corn-environment: &corn-environment mapping, or directly
    inside the existing services.corn.environment mapping if not using the anchor:

    CORN_ALLOWED_ORIGINS: "https://ai.yawn.dev"
    

    Keep all other environment, keys, project name and data mounts. Then:

    docker compose -f compose.local.yaml config --quiet
    docker compose -f compose.local.yaml up -d --pull always --no-build --no-deps corn
    curl -i -X OPTIONS 'https://corn.yawn.dev/api/openapi.json' \
      -H 'Origin: https://ai.yawn.dev' \
      -H 'Access-Control-Request-Method: GET' \
      -H 'Access-Control-Request-Headers: authorization,content-type'
    

    Expect HTTP 200 and Access-Control-Allow-Origin: https://ai.yawn.dev. Use the WebUI
    origin, not Corn's URL or a path. Multiple origins may be comma-separated. Recreate
    the container after editing (restart alone does not update environment).
    Refresh/Verify the Open WebUI connection with a fresh Corn Bearer key; revoke any
    key exposed in a screenshot. No database migration. Never down -v.

    Verification

    275 pytest tests pass, covering configuration rejection/normalization, allowed and
    denied preflights, actual schema/API responses, authentication preservation, 500
    responses, disabled defaults and private-route exclusions. Browser smoke now performs
    real cross-origin preflight+fetches (localhost versus 127.0.0.1), checks readable 401
    and browser blocking of unapproved origins, plus existing mobile/no-JS console flows.

    Downloads