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

[Enhancement]: Add Remove WebDAV to web config (By Default) #6027

Closed
3 of 4 tasks
Mostafa-Moafi opened this issue May 7, 2024 · 8 comments
Closed
3 of 4 tasks

[Enhancement]: Add Remove WebDAV to web config (By Default) #6027

Mostafa-Moafi opened this issue May 7, 2024 · 8 comments

Comments

@Mostafa-Moafi
Copy link
Contributor

Mostafa-Moafi commented May 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description of problem

We can't use develop API with DELETE or PUT Verb in our module because there isn't <remove name="WebDAVModule" /> in web config

Description of solution

Just enough to add <remove name="WebDAVModule" /> to configuration/system.webServer/modules node in web config but we should check if the <remove name="WebDAVModule" /> element exists.

Description of alternatives considered

No response

Anything else?

No response

Do you be plan to contribute code for this enhancement?

  • Yes

Would you be interested in sponsoring this enhancement?

  • Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
@valadas
Copy link
Contributor

valadas commented May 7, 2024

I don't think DNN should itself remove WebDAV IMO. If an extension does not work with WebDAV enabled then I think the extension itself should modify the web.config

@jeremy-farrance
Copy link
Contributor

jeremy-farrance commented May 7, 2024

I like this idea. We do this as a post-deploy step on every DNN site just because its so hard to diagnose when it crops up as an issue. Its a prevention that can save a LOT of time while having zero downside(s).

@mitchelsellers
Copy link
Contributor

There are a number of third-party modules that require/use webdav and a forceful removal of this by DNN Platform would for sure break installations. I would tend to agree with @valadas here.

@dnnsoftware/approvers any other thoughts?

@Mostafa-Moafi
Copy link
Contributor Author

I don't think DNN should itself remove WebDAV IMO. If an extension does not work with WebDAV enabled then I think the extension itself should modify the web.config

On some servers, the WebDAV module is preventing the DELETE requests and in such cases, the API won't work (the delete functionality).

I think We should change the web.config as explained in the post below and the solution with the most votes.

https://stackoverflow.com/questions/9854602/asp-net-web-api-405-http-verb-used-to-access-this-page-is-not-allowed-how

Also, I Implemented this topic in my module

https://github.com/Mostafa-Moafi/DnnReactModule/blob/f6cf8ce4879de2dc887ffdab01376be0a40ceae2/Utilities/ConfigurationModule.cs

@jeremy-farrance
Copy link
Contributor

@Mostafa-Moafi - since this is easily fixable once discovered and - as pointed out above - it would break existing modules (that use WebDAV) unnecessarily, this proposed enhancement seems like it won't be considered.

As an alternative, maybe propose a solution that provides a warning somehow/somewhere so that when DNN is installed on a server with WebDAV already in place, the situation is surfaced at the Host (or Admin) level. This seems to be about the best we can hope for. This would have been tremendously helpful to me a few times in the last 8 years or so. I am used to it now, but the first time I encountered this it burned a significant amount of time learning and getting to the root cause.

Although maybe the idea has some merit as a change for v10?

@donker
Copy link
Contributor

donker commented May 16, 2024

Sorry, I only see this now. Yes, it is annoying that IIS somehow assumes you want WebDAV and captures these verbs. In my module I add the necessary web.config addition to ensure it is switched off. This is, IMHO, best practice. So if you have an extension that needs these verbs, add the config change script.

@jeremy-farrance
Copy link
Contributor

The topic (problem and fix) are discussed in some detail here.
2sic/2sxc#2205

It has always bugged me that this WebDAV bug exists and it rudely "handles" and does not pass things on to Extensionless-URL handler. And there is no way I know of to manage the order of the handlers.

@donker
Copy link
Contributor

donker commented May 16, 2024

And there is no way I know of to manage the order of the handlers.

In your web.config change/install script you can specify where the Remove WebDAV gets inserted if that is what you mean.

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

No branches or pull requests

5 participants