-
Notifications
You must be signed in to change notification settings - Fork 116
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
Violation check constraint "http_method_check" for request 'MKCOL' #159
Comments
The domain definition is there to keep people from generating random HTTP commands... maybe not a check worth having?
But if you want it checked...
|
Thank you! Why didn't I think about it myself? 😅 |
But something is still strange when sending requests with different methods. When I send a request via GET or POST to Nextcloud's so called OCS API the authorization header works fine. Here is an example:
But unfortunately this doesn't work with their Webdav API where I have to send the 'MKCOL' request:
When I do this I get an exception:
And my Nextcloud logs say:
But I am sending the same authorization header as above (ok, actually without the 'OCS-APIRequest' header, but that's for OCS only, not for Webdav). Also the corresponding curl command works just fine (and also a test with node.js):
Just wanted to check if there is something different behind the scenes, when I send an none GET, POST, PUT etc. request. |
If you read through the http_request() function you can see what's going on, but I don't see anything much different for a content-less request like this. And the error is odd too. You could turn on the client_min_messages to debug4 and see more messages in the pgsql-http side and up the verbosity on curl and see if you can see where the two diverge. |
@pramsey It looks like you end up shoving all unsupported into the GET bucket. See: and So I think MKCOL gets rewritten as GET. I have a nextcloud instance with Webdav enabled I can test. You do too :) the nextcloud.osgeo.org one. I'll take a stab at fixing. and I agree we should probably get rid of that domain check once we have the internal code fixed and assume the user knows what they are doing. |
- Define a new thing called HTTP_UNKNOWN - If doesn't fit our defined set of methods, mark as HTTP_UNKNOWN and pass the method type thru to curl unchanged - Get rid of http_method domain standard type enforcement Closes pramsey#159
@pramsey I took a stab at it and with my changes, I can do this now and see the folder get created in my nextcloud home folder
It doesn't return an output so maybe I need to do something else to handle return.
I know you tried to add MKCOL as an option, but there are other options for WebDav, like the commonly used I also tested:
and it returned in xml the list of documents in my nextcloud home folder. The only thing I am unsure of is for other methods if we need to set other stuff in case there is a body. I suspect so. |
For reference here is a listing of all https://webconcepts.info/concepts/http-method/ as you can see there are quite a few just for WebDav |
First of all: thank you for the great extension, which helps me a lot in my current project! 👍
But my current issue is as follows:
I need to call a Nextcloud API to create a folder when I insert some data into my database. The problem is, that Nexcloud API needs to receive an MKCOL request (see their documentation).
So when I do this in my code:
I get the following Error:
[23514] ERROR: value for domain http_method violates check constraint "http_method_check"
As it seems MKCOL requests are not allowed. But why? Is there any way around this issue?
Really appreciate any help! :-)
The text was updated successfully, but these errors were encountered: