hotfix: corrige double-encoding em robots.txt, sitemap.xml, cors.ts e .tsc-baseline.json (PR #618)#622
Conversation
… direto (11 URLs promogifts.com.br)
…cript UTF-8 direto; fallback→www.promogifts.com.br; remove pqpdolkaeqlyzpdpbizo
…N UTF-8 direto; useProfileRoles removido, totalErrors 337→335
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review WalkthroughAtualização de configuração centralizada de CORS para edge functions com fallback para produção, reformatação de arquivos estáticos SEO (robots/sitemap) e recalibração do baseline de erros TypeScript. ChangesSEO Static Files
TypeScript Baseline Update
CORS Configuration and Validation
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
Pull request overview
This hotfix restores four files that were accidentally committed as base64 payloads (double-encoded), replacing them with their intended plain-text content so SEO assets, Edge Functions, and CI tooling can parse them correctly.
Changes:
- Restored readable
robots.txtand validsitemap.xmlto re-enable correct crawler directives and URL discovery. - Restored TypeScript source for
supabase/functions/_shared/cors.ts, including the intended production fallback origin and allowlist updates. - Restored valid JSON for
.tsc-baseline.jsonso TypeScript/quality gates can consume the baseline again.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
supabase/functions/_shared/cors.ts |
Replaces base64 content with real TypeScript CORS helper code used across Edge Functions. |
public/sitemap.xml |
Replaces base64 content with real XML sitemap entries for www.promogifts.com.br. |
public/robots.txt |
Replaces base64 content with real robots directives and correct sitemap URL. |
.tsc-baseline.json |
Replaces base64 content with valid JSON baseline so CI/typecheck tooling can read it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const CORS_HEADERS_BASE = { | ||
| 'Access-Control-Allow-Headers': ALLOWED_HEADERS_VALUE, | ||
| 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', | ||
| 'Access-Control-Expose-Headers': 'x-request-id', | ||
| ...SECURITY_HEADERS, | ||
| } as const; |
| return { | ||
| ...CORS_HEADERS_BASE, | ||
| ...SECURITY_HEADERS, | ||
| 'Access-Control-Allow-Origin': getBestAllowedOrigin(origin), | ||
| }; |
🔥 Hotfix: Corrige Double-Encoding (PR #618)
Diagnóstico
Todos os 4 arquivos tinham seus conteúdos corretos codificados em base64 dentro do arquivo, ao invés do texto/código real. Isso aconteceu porque na criação do PR #618, o conteúdo já estava pré-codificado em base64 antes de ser passado ao
github_create_or_update_file, causando dupla codificação.Prova da Correção (comparação de tamanhos)
public/robots.txtpublic/sitemap.xmlcors.ts.tsc-baseline.jsonImpacto Real dos Bugs
robots.txtsitemap.xmlcors.ts.tsc-baseline.jsonArquivos NÃO alterados (já corretos)
src/hooks/auth/useProfileRoles.ts— TypeScript real, BUG-01/02/03 corretos (20/20 checks)index.html— HTML real, BUG-06 corretoValidação Pós-Merge
Summary by cubic
Fixes double-encoded files and tightens CORS defaults. Restores valid text/XML/TS/JSON so SEO, edge functions, and CI work as expected.
Bug Fixes
public/robots.txtand real XML inpublic/sitemap.xmlto restore SEO.supabase/functions/_shared/cors.tsand valid JSON in.tsc-baseline.json(nowtotalErrors: 335) to fix edge deploys and CI.Security
https://www.promogifts.com.br.https://pqpdolkaeqlyzpdpbizo.supabase.cofrom the allowlist.Written for commit cf8108d. Summary will update on new commits.
Summary by CodeRabbit
Release Notes