Merge lp:~bryan-tongminh/bzr-webdav/ctype-fix into lp:bzr-webdav

Proposed by Bryan-tongminh
Status: Merged
Merged at revision: 70
Proposed branch: lp:~bryan-tongminh/bzr-webdav/ctype-fix
Merge into: lp:bzr-webdav
Diff against target: 14 lines (+2/-1)
1 file modified
webdav.py (+2/-1)
To merge this branch: bzr merge lp:~bryan-tongminh/bzr-webdav/ctype-fix
Reviewer Review Type Date Requested Status
Vincent Ladeuil Needs Fixing
Bazaar Developers Pending
Review via email: mp+77824@code.launchpad.net

Description of the change

Not specifying a content-type header caused urllib2 to send the PROPFIND request as application/www-form-urlencoded, causing IIS6 to return a 415 error code. Sending the appropriate Content-type: application/xml fixes this.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Thanks for catching that, there is another request that needs the same fix, I'll do that while merging.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

Hmm, RFC2518 uses 'text/xml' rather than 'application/xml'. Does the former also address the issue for you ? I'd rather use that if that's the case.

review: Needs Fixing
Revision history for this message
Bryan-tongminh (bryan-tongminh) wrote :

RFC4918 uses application/xml in its examples: http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND

As far as I'm aware it should not matter which one to use. I'll see if I can test it later this week.

Revision history for this message
Vincent Ladeuil (vila) wrote :

> RFC4918 uses application/xml in its examples: http://webdav.org/specs/rfc4918.html#METHOD_PROPFIND

Argh ! <paper:rfc2518?page=22> ! You betrayed me !

> As far as I'm aware it should not matter which one to use.

I thought so too, but I've switched to application/xml anyway :)

> I'll see if I can test it later this week.

Thanks, not needed anymore :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'webdav.py'
2--- webdav.py 2011-06-14 09:21:57 +0000
3+++ webdav.py 2011-10-02 14:38:29 +0000
4@@ -762,8 +762,9 @@
5 </D:propfind>
6 """
7 request = _urllib2_wrappers.Request('PROPFIND', abspath, propfind,
8- {'Depth': '0'},
9+ {'Depth': '0', 'Content-Type': 'application/xml; charset="utf-8"'},
10 accepted_errors=[207, 404, 409,])
11+
12 response = self._perform(request)
13
14 code = response.code

Subscribers

People subscribed via source and target branches

to all changes: