The Boilerplate app: all ICU data, indexable Test deployments, 404 redirects, security headers and CSP

Aperta
#14,612 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yasmoradi ci sta già lavorando.

Dal 4/11/2026.

  • #14654 di @yasmoradi — integrata

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

area / templates

Comparing the bit Boilerplate app's infrastructure with its landing page turned up these problems.

Every visitor downloads all the ICU data. Boilerplate.Client.Web.csproj sets BlazorWebAssemblyLoadAllGlobalizationData to true on multilingual builds, so each visitor gets the whole icudt.dat. Measured on a published landing page, that file is 322 KB, while the shard a page needs is 141 KB in English and 217 KB in Persian.

A Test deployment can be indexed. There is no noindex or X-Robots-Tag anywhere in the app, and robots.txt is a fixed file with an empty Disallow. A Test deployment can be crawled and reach search results, /api included.

A missing page redirects before it answers 404. Handle40XStatusCodes answers any request with no endpoint with a redirect to /not-found?url=..., and only that page answers 404. The address the visitor typed changes, and a crawler takes an extra round trip. Only /_framework and /_content are left out, so a missing image or /api/... also gets the redirect and a full page render.

Security headers. X-XSS-Protection is obsolete, yet it is still sent from UseSecurityHeaders, _headers and staticwebapp.config.json. Cross-Origin-Opener-Policy isn't sent. Social sign-in comes back through window.opener.postMessage, so same-origin would break it.

CSP. Pages get two Content-Security-Policy headers, the small one from UseSecurityHeaders and the full one from App.razor.cs, and browsers apply both. The full one allows fonts.googleapis.com and fonts.gstatic.com, which nothing in the project uses. On the landing page, img-src and connect-src allow any https: address, and there is no base-uri.

Lingua principale
C#
Stelle
1.4k
Fork
264
Merge medio
10h 8m
PR unite (30g)
487

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bitfoundation/bitplatform

Tutte le issue di bitfoundation/bitplatform

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.