Handling dynamic headers from transformFile
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong src/AjaxUploader.jsx, tại các headers được truyền vào yêu cầu upload, và xem xét luồng transformFile được mô tả trong issue. Cập nhật mục headers trong README cùng với hành vi này. Hoàn tất khi headers có thể được cung cấp dưới dạng một hàm nhận file đã được transform, trong khi headers dạng object vẫn tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi there!
We have a situation where we use rc-upload in the following manner:
- User selects file on file system
- We use
transformFileto encrypt the contents of that file on the browser - The encryption generates additional metadata that we want to pass as headers
- This metadata is not available until transformFile is completed.
It would be great if headers could also be a function that takes in the result of transformFile and returns the headers.
I tried to make a PR for this but it was not possible bc of permissions.
The changes to do this are pretty quick:
in AjaxUploader.tsx
change
headers: props.headers,
to
headers: typeof props.headers === 'function' ? props.headers(transformedFile) : props.headers,
and also update the README comment to me
|headers| object/function(blob) | {} | http headers to post, available in modern browsers. Can be a function that takes in the result of transformFile |
- Ngôn ngữ chính
- TypeScript
- Star
- 804
- Fork
- 323
- Merge trung bình
- 12 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react-component/upload
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
react-component/upload#170 ·
-
HVAC website Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
react-component/upload#697 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 15/100
react-component/upload#615 ·
-
开启文件夹上传时就不能多选文件上传,可以解决吗? Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
react-component/upload#522 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
react-component/upload#515 ·
Tất cả issue của react-component/upload
Issue tương tự
-
comp/desktop P3 type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-javascript#24577 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Add 2021 Cup data to website Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chrisparsons83/flexspotff#153 ·