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

Handle data with non-standard methods #164

Closed
robe2 opened this issue Aug 4, 2023 · 1 comment · Fixed by #165
Closed

Handle data with non-standard methods #164

robe2 opened this issue Aug 4, 2023 · 1 comment · Fixed by #165

Comments

@robe2
Copy link
Contributor

robe2 commented Aug 4, 2023

This is a continuation of #159

I realize now as I suspected, I'm throwing out the data part for UNKNOWN.

So this kind of request will be properly handled

Following examples from https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html

SELECT h.content::xml FROM http((
    'PROPFIND',
    'https://nextcloud.osgeo.org/remote.php/dav/files/username',
    ARRAY [
        http_header('Authorization', 'Basic ' || encode('username:passwordhere'::bytea, 'base64'))
        ],
    'text/xml',
   '<?xml version="1.0" encoding="UTF-8"?>
    <d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
      <d:prop>
        <d:getcontenttype/>
        <oc:size />
        <oc:owner-display-name />
      </d:prop>
    </d:propfind>'
    )::http_request) AS h;

Right now the data part is ignored, so I always get all the default elements back. So I think for UNKNOWN with content, the best course of action is to follow the HTTP_PUT AND HTTP_PATCH paths. I think there are some that have extra bits we might need to handle explicitly but can handle those later.

I'll send another pull request in soon.

robe2 added a commit to robe2/pgsql-http that referenced this issue Aug 4, 2023
@robe2
Copy link
Contributor Author

robe2 commented Aug 4, 2023

I tested with PROPFIND. No issue with PROPFIND and result had the extra owner-display-name I was expecting and other items I left out no longer there.

I also tested this with PROPPATCH command using the example here - https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#settings-favorites

and it worked in that the document I chose to favorite showed a nice star on it when I logged into nextcloud.
However even though it worked it showed a timeout on the http call.

ERROR:  Operation timed out after 5001 milliseconds with 0 bytes received 

Not sure if that is a misconfiguration on nextcloud or we need to do something extra to return some outputs..

I haven't looked at the nextcloud logs to see if it registered any error.

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

Successfully merging a pull request may close this issue.

1 participant