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

Different response status code while searching with empty pattern with new webdav #4016

Closed
SagarGi opened this issue Jun 23, 2022 · 0 comments · Fixed by #4094
Closed

Different response status code while searching with empty pattern with new webdav #4016

SagarGi opened this issue Jun 23, 2022 · 0 comments · Fixed by #4094
Labels

Comments

@SagarGi
Copy link
Member

SagarGi commented Jun 23, 2022

Describe the bug

While searching files | folders with empty pattern oc10 and ocis response are different.

Steps to reproduce

Steps to reproduce the behavior:

  1. create user uu1
  2. upload file upload.txt
  3. upload folder demo

Curl command for empty pattern search with new webdav

curl -X REPORT -vk -u u11:123456 https://host.docker.internal:9200/remote.php/dav/files/u11/ -d '<?xml version="1.0" encoding="UTF-8"?>
<oc:search-files
    xmlns:a="DAV:"
    xmlns:oc="http://owncloud.org/ns">
    <oc:search>
        <oc:pattern></oc:pattern>
    </oc:search>
</oc:search-files>'

Expected behavior

Response on OC10

oc10 response details
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'u11'
> REPORT /federated/remote.php/dav/files/u11/ HTTP/1.1
> Host: localhost
> Authorization: Basic dTExOjEyMzQ1Ng==
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 199
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 199 out of 199 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Date: Thu, 23 Jun 2022 06:34:33 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: oc226l3914ug=oh43rphr7l1j65rf3f4unni5b7; path=/federated; HttpOnly; SameSite=Strict
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Set-Cookie: oc_sessionPassphrase=VTidoz4avzxD14UqIw3MIOuYxyPvGYFn8nowv0PFZfJJmgWTSfh1wiP0%2BWpL%2FM3pbV2sIXx8LAw2fNrGeVOFrgBetfgponr8H%2BkLAbC4Xz7aoAxvegLh26CQSe5BowhG; expires=Thu, 23-Jun-2022 06:54:33 GMT; Max-Age=1200; path=/federated; HttpOnly; SameSite=Strict
< Content-Security-Policy: default-src 'none';
< Set-Cookie: oc226l3914ug=eihi2c9ch4kgh3hupvds0g4u69; path=/federated; HttpOnly; SameSite=Strict
< Set-Cookie: cookie_test=test; expires=Thu, 23-Jun-2022 07:34:34 GMT; Max-Age=3600
< Content-Length: 224
< Connection: close
< 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\BadRequest</s:exception>
  <s:message>Search pattern cannot be empty</s:message>
</d:error>
* Closing connection 0

Actual behavior

Response on OCIS

ocis response details
* TCP_NODELAY set
* Connected to host.docker.internal (127.0.0.1) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: O=Acme Corp; CN=OCIS
*  start date: Jun 23 06:22:48 2022 GMT
*  expire date: Jun 23 06:22:48 2023 GMT
*  issuer: O=Acme Corp; CN=OCIS
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Server auth using Basic with user 'uu1'
> REPORT /remote.php/dav/files/u11/ HTTP/1.1
> Host: host.docker.internal:9200
> Authorization: Basic dXUxOjEyMzQ1Ng==
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 199
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 199 out of 199 bytes
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
< Content-Length: 339
< Content-Security-Policy: frame-ancestors 'none'
< Content-Type: application/xml; charset=utf-8
< Date: Thu, 23 Jun 2022 06:32:10 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Last-Modified: Thu, 23 Jun 2022 06:32:10 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-Webdav-Version: 2.0.0-beta.3+a5dfd89e2
< 
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host host.docker.internal left intact
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception></s:exception><s:message>{&#34;id&#34;:&#34;go.micro.client&#34;,&#34;code&#34;:500,&#34;detail&#34;:&#34;error: precondition failed: empty query provided&#34;,&#34;status&#34;:&#34;Internal Server Error&#34;}</s:message></d:error>

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS = latest docker image

Additional context

Add any other context about the problem here.

@SagarGi SagarGi changed the title Different response while searching with empty pattern with new webdav Different response status code while searching with empty pattern with new webdav Jun 23, 2022
@aduffeck aduffeck mentioned this issue Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant