wrong content type #63

Closed
opened 2025-12-28 18:00:01 +00:00 by sami · 5 comments
Owner

Originally created by @532910 on GitHub (Feb 29, 2024).

Originally assigned to: @smallhive on GitHub.

% curl -sI https://nspcc.io/css/style.css | grep '^conte'
content-type: application/json
Originally created by @532910 on GitHub (Feb 29, 2024). Originally assigned to: @smallhive on GitHub. ``` % curl -sI https://nspcc.io/css/style.css | grep '^conte' content-type: application/json ```
sami 2025-12-28 18:00:01 +00:00
  • closed this issue
  • added the
    bug
    S4
    I4
    U0
    labels
Author
Owner

@roman-khimov commented on GitHub (Feb 29, 2024):

Please, add more details in future (CID at least or direct REST/HTTP requests). It's hard to even reproduce this without this data.

@roman-khimov commented on GitHub (Feb 29, 2024): Please, add more details in future (CID at least or direct REST/HTTP requests). It's hard to even reproduce this without this data.
Author
Owner

@roman-khimov commented on GitHub (Feb 29, 2024):

$ curl -Is https://http.fs.neo.org/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css
HTTP/2 200 
server: nginx
date: Thu, 29 Feb 2024 12:03:24 GMT
content-type: text/css
content-length: 321528
vary: Accept-Encoding
x-attribute-filepath: css/style.css
x-attribute-content-type: text/css
x-attribute-filename: style.css
x-attribute-timestamp: 1709065193
last-modified: Tue, 27 Feb 2024 20:19:53 GMT
x-object-id: 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw
x-owner-id: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg
x-container-id: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU
content-disposition: inline; filename=style.css
x-neofs-payload-length: 321528
$ curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css
HTTP/2 404 
server: nginx
date: Thu, 29 Feb 2024 12:03:38 GMT
content-type: application/json
vary: Accept-Encoding
access-control-allow-origin: *
strict-transport-security: max-age=63072000; includeSubDomains
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN

I guess the problem is /, although

$ curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css%2Fstyle.css
HTTP/2 404 
server: nginx
date: Thu, 29 Feb 2024 12:05:36 GMT
content-type: application/json
vary: Accept-Encoding
access-control-allow-origin: *
strict-transport-security: max-age=63072000; includeSubDomains
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
@roman-khimov commented on GitHub (Feb 29, 2024): ``` $ curl -Is https://http.fs.neo.org/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css HTTP/2 200 server: nginx date: Thu, 29 Feb 2024 12:03:24 GMT content-type: text/css content-length: 321528 vary: Accept-Encoding x-attribute-filepath: css/style.css x-attribute-content-type: text/css x-attribute-filename: style.css x-attribute-timestamp: 1709065193 last-modified: Tue, 27 Feb 2024 20:19:53 GMT x-object-id: 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw x-owner-id: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg x-container-id: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU content-disposition: inline; filename=style.css x-neofs-payload-length: 321528 $ curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css HTTP/2 404 server: nginx date: Thu, 29 Feb 2024 12:03:38 GMT content-type: application/json vary: Accept-Encoding access-control-allow-origin: * strict-transport-security: max-age=63072000; includeSubDomains x-content-type-options: nosniff x-frame-options: SAMEORIGIN ``` I guess the problem is `/`, although ``` $ curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css%2Fstyle.css HTTP/2 404 server: nginx date: Thu, 29 Feb 2024 12:05:36 GMT content-type: application/json vary: Accept-Encoding access-control-allow-origin: * strict-transport-security: max-age=63072000; includeSubDomains x-content-type-options: nosniff x-frame-options: SAMEORIGIN ```
Author
Owner

@532910 commented on GitHub (Mar 1, 2024):

Please, add more details in future (CID at least or direct REST/HTTP requests). It's hard to even reproduce this without this data.

Yep, sorry.

Only index.html works:

% curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/index.html
HTTP/2 200 
server: nginx
date: Fri, 01 Mar 2024 02:54:07 GMT
content-type: text/html
content-length: 45281
vary: Accept-Encoding
access-control-allow-origin: *
content-disposition: inline; filename=index.html
last-modified: Tue, 27 Feb 2024 20:19:36 GMT
x-attribute-filename: index.html
x-attribute-filepath: index.html
x-attribute-timestamp: 1709065176
x-container-id: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU
x-object-id: CpDkKHpBKnFMfhWKSGkwd9bQZPG6NH6bUrJGpUuPV9jz
x-owner-id: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg
strict-transport-security: max-age=63072000; includeSubDomains
content-security-policy: frame-ancestors 'none';
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
referrer-policy: same-origin

all other files are 404 json

@532910 commented on GitHub (Mar 1, 2024): > Please, add more details in future (CID at least or direct REST/HTTP requests). It's hard to even reproduce this without this data. Yep, sorry. Only index.html works: ``` % curl -Is https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/index.html HTTP/2 200 server: nginx date: Fri, 01 Mar 2024 02:54:07 GMT content-type: text/html content-length: 45281 vary: Accept-Encoding access-control-allow-origin: * content-disposition: inline; filename=index.html last-modified: Tue, 27 Feb 2024 20:19:36 GMT x-attribute-filename: index.html x-attribute-filepath: index.html x-attribute-timestamp: 1709065176 x-container-id: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU x-object-id: CpDkKHpBKnFMfhWKSGkwd9bQZPG6NH6bUrJGpUuPV9jz x-owner-id: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg strict-transport-security: max-age=63072000; includeSubDomains content-security-policy: frame-ancestors 'none'; x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-xss-protection: 1; mode=block referrer-policy: same-origin ``` all other files are 404 json
Author
Owner

@smallhive commented on GitHub (Mar 1, 2024):

I tend to think application/json because it is a real JSON

curl https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css%2Fstyle.css
{"code":404,"message":"path /v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css was not found"}
@smallhive commented on GitHub (Mar 1, 2024): I tend to think `application/json` because it is a real JSON ``` curl https://rest.fs.neo.org/v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css%2Fstyle.css ``` ```json {"code":404,"message":"path /v1/get_by_attribute/Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU/FilePath/css/style.css was not found"} ```
Author
Owner

@roman-khimov commented on GitHub (Mar 1, 2024):

Nope. It's because of 404, the object is not resolved by attribute correctly. It has Content-Type set btw:

$ ./bin/neofs-cli object head -r grpcs://st3.storage.fs.neo.org:8082 --cid Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU --oid 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw
ID: 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw
CID: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU
Owner: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg
CreatedAt: 21601
Size: 321528
HomoHash: 5535cc331d86d2b87afa590ad83ef45b6c8809ae54b4c21b928e9b465f52c1eb11f1b305c6c1d45d00e37152aff01bf03223d810553b8b9e7059862c41a3e950
Checksum: 205ebe1747e126eeb7a8cda5d06857c7c112b91ddaaa799e3a5ec2d7b5e58979
Type: REGULAR
Attributes:
  FilePath=css/style.css
  Content-Type=text/css
  FileName=style.css
  Timestamp=1709065193 (2024-02-27 23:19:53 +0300 MSK)
ID signature:
  public key: 03f973173172be8afc514a3bea29c898398628a152e8ae6bb6bf7b509001e549e0
  signature: 041621c1509df9052b73385ee05f08a3671d202e26d091a4d62b1d9c21dde1bd34b735ba5bd1f60dfd5a927ba017170d143c6e3cde2a4fb206a7efac62b1fe49c1
@roman-khimov commented on GitHub (Mar 1, 2024): Nope. It's because of 404, the object is not resolved by attribute correctly. It has `Content-Type` set btw: ``` $ ./bin/neofs-cli object head -r grpcs://st3.storage.fs.neo.org:8082 --cid Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU --oid 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw ID: 3yFUk8waYSsBgKvG4wvhYGjruSXQvKCh9WJkbMjYSPxw CID: Cb9NVeW9jVuEMbJcwasMdBYZKBGvTMpQSMEoXjBJYFYU Owner: NhNT6EFqrDu7hAsv2V1J3B7J1DKLvkNGRg CreatedAt: 21601 Size: 321528 HomoHash: 5535cc331d86d2b87afa590ad83ef45b6c8809ae54b4c21b928e9b465f52c1eb11f1b305c6c1d45d00e37152aff01bf03223d810553b8b9e7059862c41a3e950 Checksum: 205ebe1747e126eeb7a8cda5d06857c7c112b91ddaaa799e3a5ec2d7b5e58979 Type: REGULAR Attributes: FilePath=css/style.css Content-Type=text/css FileName=style.css Timestamp=1709065193 (2024-02-27 23:19:53 +0300 MSK) ID signature: public key: 03f973173172be8afc514a3bea29c898398628a152e8ae6bb6bf7b509001e549e0 signature: 041621c1509df9052b73385ee05f08a3671d202e26d091a4d62b1d9c21dde1bd34b735ba5bd1f60dfd5a927ba017170d143c6e3cde2a4fb206a7efac62b1fe49c1 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-rest-gw#63
No description provided.