storage: compare upload types by media type and accept a per-caller allowlist

Aperta
#348 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Start by reading the upload service implementation, especially WithAllowedUploadTypes, ValidMediaType, and NewService, to trace how MIME types are checked and how inline safety is enforced. Then inspect the upload tests and add coverage for parameterized and case-varied media types plus a per-upload allowlist. Done means matching ignores case and parameters while preserving the submitted type, and caller allowlists receive the same inline-safety check.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

WithAllowedUploadTypes compares the whole MIME string with its list, and ValidMediaType rejects parameters, so a type sent with parameters (text/html; charset=utf-8) can never match. A Service also has one allowlist for every caller.

A host that lets a trusted caller store a type its users may not has to build a second Service with no allowlist and check types itself. Options added later to the main Service then miss the second one.

Proposal: compare upload types by media type (case and parameters ignored; the type is still stored as sent), and let a caller pass an allowlist for one upload, subject to the same inline-safety check NewService applies to its own list.

Lingua principale
Go
Stelle
6
Fork
8
Merge medio
21h 36m
PR unite (30g)
42

Preparare l'ambiente

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 OpenNSW/core

Tutte le issue di OpenNSW/core

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.