SPB Git

spb/zyquo-router Public MIT

One local endpoint, every AI provider — a private OpenAI-compatible LLM gateway for your Mac (170 models, 12 providers).

Swift 95.7% Python 2.3% Shell 1.2% Makefile 0.9%
855 B · 32 lines swift
Raw Blame History
1//2//  CORS.swift3//  Zyquo Router4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//8//  Permissive-by-default CORS so browser-based tooling can call the router9//  on localhost. Configurable origin in Settings (Phase 6).10//1112import Foundation13import NIOHTTP11415struct CORS {16    var allowedOrigin: String = "*"1718    var headers: [(String, String)] {19        [20            ("Access-Control-Allow-Origin", allowedOrigin),21            ("Access-Control-Allow-Methods", "GET, POST, OPTIONS"),22            ("Access-Control-Allow-Headers", "Authorization, Content-Type, OpenAI-Beta, X-Requested-With"),23            ("Access-Control-Max-Age", "600"),24        ]25    }2627    /// Response to a preflight `OPTIONS` request.28    func preflightResponse() -> RouteResult {29        .complete(status: .noContent, headers: headers, body: Data())30    }31}32