-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Error: Unexpected close tag #121
Comments
Hi @claviska - Sorry to hear! This will most likely be in the update to the parsing of the XML response from your server. In v1 it was a bit more restrictive, which caused issues when attempting to parse responses from WebDAV servers like Seafile. It's possible there could be a problem with this mechanism. I'd need to see the response from your server, however.. Would it be at all possible for you to share it? You could use EDIT: Sorry for the late response - Christmas holidays and such. |
Thanks. I'm troubleshooting this more today. It looks all the other methods are working fine (e.g. Here's the axios request: { url: 'http://example-website.net/webdav',
method: 'PROPFIND',
headers:
{ Accept: 'text/plain',
Depth: 1,
Authorization: 'Basic ********' },
responseType: 'text' } And here's he axios response: <!doctype html>
<html lang="en">
<head>
<title>Untitled</title>
<meta charset="utf-8">
<meta name="description" content="Lorem ipsum dolor...">
</head>
<body>
<h1>Untitled</h1>
<p>Lorem ipsum dolor...</p>
</body>
</html> That HTML is the source of the I'll keep digging and let you know what I find. |
I just learned that appending a trailing slash to the request returns the proper XML response:
The trailing slash is stripped here, but it looks like Do you foresee any issues removing that |
Hmm.. It's hard to say. It could potentially be a breaking change - I don't really see why the server would differentiate between the two - it's really the same path that a request is being made to. Normally when requesting URLs in the browser (say with a query string), no differentiation is actually made between say At least right now the current stable code in master works fine on a variety of services.. So I wonder if it's also something to do with specific config on your site. Are you running your own Apache/nginx config with any particular pathing rules? |
I initially thought it's because the WebDAV-enabled directory is located in a subdirectory: http://example-website.com/webdav/ I figured that when Apache receives a request without the trailing slash, it doesn't get passed to the WebDAV module and the web server would reply with the HTML as usual. However, I just tried listing a subdirectory with and without the trailing slash and the same thing happens. 😕 So it seems with DreamHost's WebDAV, the only way you'll receive a WebDAV response for a directory listing is with a trailing slash.
Again, this is a DreamHost test box that I've enabled WebDAV on. They have their own control panel, so the configs are all preset. I don't even have read access to view it, much less change it. I'm going to open a support ticket with them. I'll let you know what I find. |
My initial chat with DreamHost support resulted in them saying the trailing slash is required. I explained how it really shouldn't matter, and they've escalated the support request. 🤷♂️ |
@claviska After looking through the RFC (4918) for a while I found this:
Section 5.2 paragraph 8 I think that in this case it's appropriate that we force the ending slash for at least PROPFIND requests. |
Great find...I didn't think to check the RFC. Just to follow up, DreamHost seems to be set on it not being a config problem. They may be right, but there's a disconnect between support and engineering that makes it hard to tell. I'm working on a PR and here are the only places
I don't know what the best approach is for
Any thoughts or alternatives? |
I would create a helper to ensure a trailing slash - this could be used for As for Great summary @claviska - Looking forward to your PR! :) |
Released in 2.2.1. |
After upgrading to the latest 2.x version, I saw a strange error. After troubleshooting in the existing project, I decided to create a brand new project with only the following code and the same error persisted. (Note that the actual URL and credentials still work fine in 1.x).
It seems like an error parsing the WebDAV server's response, but given that 1.x still works fine I don't think it's anything to do with the server. I'm thinking it's probably related to the switch to Axios.
Thanks for your insight!
Node version: 10.2.1
The text was updated successfully, but these errors were encountered: