form-data Content-Type doesn't seem to permit setting charset for individual content fields [rt.cpan.org #69078]
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
- 35/100
Hướng nghiên cứu
Bắt đầu với POST trong HTTP::Request::Common và theo dõi cách các trường form-data được biểu diễn cũng như cách các content type của chúng được phát ra. So sánh workaround tải tệp hiện có với hành vi được yêu cầu đối với trường biểu mẫu không phải tệp; được xem là hoàn tất khi một trường có thể mang charset tường minh mà không bị xử lý như một lượt tải tệp lên, với coverage cho cú pháp được đề xuất và giá trị đã mã hóa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Migrated from rt.cpan.org#69078 (status was 'new')
Requestors:
From [email protected] on 2011-06-24 14:46:50:
Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being able to set the
charset for individual form-data encoded controls, POST in HTTP::Request::Common
doesn't seem to have any way of specifying the charset per field.
In particular, the content field might have wide characters that I want to encode
and transmit.
POST $url, Content => [ surname => encode('utf8',"JÄdrejek"), b64_data => $base64_string
], Content_Type => 'form-data';
The receiving doesn't know what encoding was used for surname in the case above.
Perhaps the following syntax instead?
Content => [ surname => { Content => $encoded_string, Content_Type=> 'text/plain;
charset='utf8' }, b64_data => $base64_string ]
Regrettably I've no patch to offer. Perhaps there is a way to achieve this currently, but I didn't
work it out.
From [email protected] on 2011-06-24 15:01:14:
Reading more carefully, there is actually a work-around that is very much like the suggested
syntax.
{ surname => [undef,"t1.txt",Content=>encode("utf8","JÄdrejek"),Content_Type=>"text/plain;
charset=utf8"] }
On Fri Jun 24 10:46:50 2011, [email protected] wrote:
> Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being able
> to set the
> charset for individual form-data encoded controls, POST in
> HTTP::Request::Common
> doesn't seem to have any way of specifying the charset per field.
>
> In particular, the content field might have wide characters that I
> want to encode
> and transmit.
>
> POST $url, Content => [ surname => encode('utf8',"JÄdrejek"), b64_data
> => $base64_string
> ], Content_Type => 'form-data';
>
> The receiving doesn't know what encoding was used for surname in the
> case above.
>
> Perhaps the following syntax instead?
>
> Content => [ surname => { Content => $encoded_string, Content_Type=>
> 'text/plain;
> charset='utf8' }, b64_data => $base64_string ]
>
> Regrettably I've no patch to offer. Perhaps there is a way to achieve
> this currently, but I didn't
> work it out.
From [email protected] on 2011-06-24 15:21:52:
that form means the server treats those as file uploads rather than parameters though.
On Fri Jun 24 11:01:14 2011, [email protected] wrote:
> Reading more carefully, there is actually a work-around that is very
> much like the suggested
> syntax.
>
> { surname =>
> [undef,"t1.txt",Content=>encode("utf8","JÄdrejek"),Content_Type=>"text/plain;
> charset=utf8"] }
>
>
> On Fri Jun 24 10:46:50 2011, [email protected] wrote:
> > Although the HTML 4.01 spec and the HTTP 1.1 spec refer to being
> able
> > to set the
> > charset for individual form-data encoded controls, POST in
> > HTTP::Request::Common
> > doesn't seem to have any way of specifying the charset per field.
> >
> > In particular, the content field might have wide characters that I
> > want to encode
> > and transmit.
> >
> > POST $url, Content => [ surname => encode('utf8',"JÄdrejek"),
> b64_data
> > => $base64_string
> > ], Content_Type => 'form-data';
> >
> > The receiving doesn't know what encoding was used for surname in the
> > case above.
> >
> > Perhaps the following syntax instead?
> >
> > Content => [ surname => { Content => $encoded_string, Content_Type=>
> > 'text/plain;
> > charset='utf8' }, b64_data => $base64_string ]
> >
> > Regrettably I've no patch to offer. Perhaps there is a way to
> achieve
> > this currently, but I didn't
> > work it out.
>
>
- Ngôn ngữ chính
- Perl
- Star
- 32
- Fork
- 62
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 libwww-perl/HTTP-Message
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
libwww-perl/HTTP-Message#228 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
libwww-perl/HTTP-Message#227 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
libwww-perl/HTTP-Message#216 ·
-
Please add a security policyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
libwww-perl/HTTP-Message#207 · 1 bình luận ·
-
Decoding of deflate content-encoding doesn't respect max_body_sizeCó thể đã có người làm @simbabque đã nhận 539 ngày trước. Đang mở
libwww-perl/HTTP-Message#206 · 1 bình luận · 1 người được giao ·
Tất cả issue của libwww-perl/HTTP-Message
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RotherOSS/otobo#6286 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
LMS-Community/slimserver#1692 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLsCó thể đã có người làm @muntasir-396 đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openfoodfacts/openfoodfacts-server#15042 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 3 ngày