Created
February 2, 2026 03:30
-
-
Save tiye/4d679f948fe9076b49bc45d980076827 to your computer and use it in GitHub Desktop.
Proxy on Gemini interactions API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (cors) { | |
| @cors_preflight method OPTIONS | |
| handle @cors_preflight { | |
| header Access-Control-Allow-Origin "{args.0}" | |
| header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" | |
| header Access-Control-Allow-Headers "Content-Type, Authorization, x-goog-api-key, x-goog-api-client, x-stainless-lang, x-stainless-package-version, x-stainless-os, x-stainless-arch, x-stainless-runtime, x-stainless-runtime-version, x-stainless-retry-count, x-stainless-retry-count" | |
| header Access-Control-Max-Age "3600" | |
| respond @cors_preflight 204 | |
| } | |
| header Access-Control-Allow-Origin "{args.0}" | |
| header Access-Control-Expose-Headers "Link" | |
| } | |
| demo.demo.demo { | |
| import cors * | |
| reverse_proxy /* https://generativelanguage.googleapis.com { | |
| header_up Host generativelanguage.googleapis.com | |
| header_up X-Forwarded-For "" | |
| header_up X-Real-IP "" | |
| header_up Forwarded "" | |
| header_down -Access-Control-Allow-Origin | |
| header_down -Access-Control-Allow-Methods | |
| header_down -Access-Control-Allow-Headers | |
| header_down -Access-Control-Allow-Credentials | |
| header_down -Access-Control-Expose-Headers | |
| header_down -Access-Control-Max-Age | |
| } | |
| header X-DEMO PROXIED | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment