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

Đang mở
#348 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
54/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
6
Fork
8
Merge trung bình
21 giờ 36 phút
Pull request đã merge (30 ngày)
42

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenNSW/core

Tất cả issue của OpenNSW/core

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.