Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting a preview of file type that doesn't support preview results in HTTP code 200 #189

Closed
swoichha opened this issue Apr 8, 2020 · 8 comments

Comments

@swoichha
Copy link
Contributor

swoichha commented Apr 8, 2020

Steps to reproduce

  • User downloads the preview of file type that doesn't support preview with width "32" and height "32"
    e.g. curl http://172.17.0.1:9140/remote.php/dav/files/admin/simple.pdf\?x\=32\&y\=32\&forceIcon\=0\&preview\=1 -u admin:admin -v

Expected

  • HTTP code 404 - Not Found

Actual

  • HTTP code 200 - OK
@PVince81
Copy link
Contributor

in the latest ocis versions I usually get a 400 bad request now

@IljaN
Copy link
Contributor

IljaN commented Apr 29, 2020

/cc @C0rby

@refs
Copy link
Member

refs commented Jan 12, 2021

@C0rby ping, still the case?

@C0rby
Copy link
Contributor

C0rby commented Jan 12, 2021

No, it's returning 404 now.

@C0rby C0rby closed this as completed Jan 12, 2021
@refs
Copy link
Member

refs commented Jan 12, 2021

thanks!

@saw-jan
Copy link
Member

saw-jan commented Jan 28, 2021

No, it's returning 404 now.

@C0rby @refs

but I am still getting 400 in oCIS with current master HEAD

curl -u admin:admin https://localhost:9200/remote.php/dav/files/admin/sample.pdf\?x\=32\&y\=32\&forceIcon\=0\&preview\=1 -v
> GET /remote.php/dav/files/admin/sample.pdf?x=32&y=32&forceIcon=0&preview=1 HTTP/1.1
> Host: localhost:9200
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
< Content-Length: 28
< Content-Type: text/plain; charset=utf-8
< Date: Thu, 28 Jan 2021 06:13:20 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Last-Modified: Thu, 28 Jan 2021 06:13:20 GMT
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-Webdav-Version: 6a47d101
< X-Xss-Protection: 1; mode=block
< 
* Connection #0 to host localhost left intact
c (etag) is missing in query%

In OC10

curl -u admin:admin http://localhost/core/remote.php/dav/files/admin/sample.pdf\?x\=32\&y\=32\&forceIcon\=0\&preview\=1 -v
> GET /core/remote.php/dav/files/admin/sample.pdf?x=32&y=32&forceIcon=0&preview=1 HTTP/1.1
> Host: localhost
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Date: Thu, 28 Jan 2021 06:18:24 GMT
< Server: Apache/2.4.41 (Ubuntu)
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 0
< X-Robots-Tag: none
< X-Frame-Options: SAMEORIGIN
< X-Download-Options: noopen
< X-Permitted-Cross-Domain-Policies: none
< Set-Cookie: ocd3fn3x61nb=n12sd6ura6nvpqks310v5ijh4q; path=/core; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=zgtvouHMtk%2FYRgV4j1PyNMu0u3g9RblTGSJaLAj5Uogqy7EtC6Rz6uVHRnAmTjMz0SBk07i0ZhxMIfA6100O7Su4mioucto%2BGbqEPW%2BkjL%2FwdsVq6OhhmFZbDalsowgX; path=/core; HttpOnly; SameSite=strict
< Content-Security-Policy: default-src 'none';
< Set-Cookie: ocd3fn3x61nb=vf8e5r5bm0lkk4hk38mmp9b7ts; path=/core; HttpOnly
< Set-Cookie: cookie_test=test; expires=Thu, 28-Jan-2021 07:18:24 GMT; Max-Age=3600
< Content-Length: 181
< Content-Type: application/xml; charset=utf-8
< 
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
  <s:message/>
</d:error>

@saw-jan
Copy link
Member

saw-jan commented Jan 28, 2021

Similar to #192 (comment)

@C0rby
Copy link
Contributor

C0rby commented Apr 12, 2021

It's returning 400 because the request doesn't contain the etag but this will be fixed with: #1898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants