nodeSolidServer / nodeSolidServer/node-solid-server

Solid server ignores content type

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

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

Ngôn ngữ chính
JavaScript
Star
1.8k
Fork
308
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have tried to upload various images to my POD and at some point I named it "x-jpg" instead of "x.jpg". It turns out that the solid server uses the filename extention to detect content type instead of relying on the actual content type.

Here is an example PUT operation showing the name "...270-jpg" and the content-type "image/jpeg":

PUT https://elfisk.solid.community/public/solidrc/images/Billede-30-10-2018-20.01.20-1541949270-jpg HTTP/1.1
Host: elfisk.solid.community
Connection: keep-alive
Content-Length: 257876
authorization: Bearer XXX
Origin: https://localhost:5001
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
content-type: image/jpeg
Accept: */*
Referer: https://localhost:5001/Home/Models
Accept-Encoding: gzip, deflate, br
Accept-Language: da-DK,da;q=0.9,en-US;q=0.8,en;q=0.7,sv;q=0.6,nb;q=0.5
Cookie: connect.sid=XXX

Later on I do a GET on https://elfisk.solid.community/public/solidrc/images/ which returns the document below. You can see that ".jpg" files have type "jpeg:Resource" whereas the "-jpg" files does not.

@prefix : <#>.
@prefix im: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
@prefix jpeg: <http://www.w3.org/ns/iana/media-types/image/jpeg#>.

im:
    a ldp:BasicContainer, ldp:Container;
    terms:modified "2018-11-11T15:14:19Z"^^XML:dateTime;
    ldp:contains
        <Billede-30-10-2018-19.52.49-1541949020.jpg>,
        <Billede-30-10-2018-20.01.20-1541949270-jpg>;
    st:mtime 1541949259.98;
    st:size 4096.
<Billede-30-10-2018-19.52.49-1541949020.jpg>
    a jpeg:Resource, ldp:Resource;
    terms:modified "2018-11-11T15:10:11Z"^^XML:dateTime;
    st:mtime 1541949011.912;
    st:size 249480.
<Billede-30-10-2018-20.01.20-1541949270-jpg>
    a ldp:Resource;
    terms:modified "2018-11-11T15:14:22Z"^^XML:dateTime;
    st:mtime 1541949262.852;
    st:size 257876.

Later on the data browser goes beserk when you try to delete the "*-jpg" image as it is served as a turtle document:

GET https://elfisk.solid.community/public/solidrc/images/Billede-30-10-2018-20.01.20-1541949270-jpg HTTP/1.1

HTTP/1.1 200 OK
X-Powered-By: solid-server
Link: <Billede-30-10-2018-20.01.20-1541949270-jpg.acl>; rel="acl", <Billede-30-10-2018-20.01.20-1541949270-jpg.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Resource>; rel="type"
Content-Type: text/turtle

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi cách máy chủ Solid xử lý PUT và GET tiếp theo đối với các tài nguyên có tên tệp không có phần mở rộng được nhận diện, sử dụng các ví dụ về yêu cầu và phản hồi trong issue này. Tái hiện thao tác tải lên với Content-Type image/jpeg và xác minh rằng tài nguyên được cung cấp dưới dạng image/jpeg thay vì text/turtle và được phân loại nhất quán với nội dung đã tải lên.

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

Đánh giá

Công nghệ
javascript, nodejs
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.