Hi,
here is an updated patch adding support for WebDAV Versioning Extensions
RFC3253.
Regards,
Paul
On Mon, Jun 27, 2016 at 09:35:20AM +0200, Paul Fariello wrote:
> Hi,
>
> I've encountered the exact same issue. I think this is due to a miss
> handling of message-body.
>
> RFC2616 states in chapter 4.3 that:
>
> > The presence of a message-body in a request is signaled by the
> > inclusion of a Content-Length or Transfer-Encoding header field in
> > the request's message-headers. A message-body MUST NOT be included in
> > a request if the specification of the request method (section 5.1.1)
> > does not allow sending an entity-body in requests. A server SHOULD
> > read and forward a message-body on any request; if the request method
> > does not include defined semantics for an entity-body, then the
> > message-body SHOULD be ignored when handling the request.
> >
>
> Thus we should not ignore message-body for unknown methods by forcing
> cre->toread to TOREAD_HTTP_HEADER.
>
> Please find attached a patch that just allow http request to have a
> message-body whatever the method is.
>
> Regards,
> Paul
>
> > 2016-06-24 11:01:03
> > <[email protected]>:
> >
> > Hi,
> >
> > thanks, this is the second report regarding WebDAV since yesterday. I'll
> > have a look \
> > at this when I'm back home next week.
> >
> > Reyk
> >
> > > Am 24.06.2016 um 09:21 schrieb Michael Lechtermann
> > > <[email protected]>:
> > >
> > > Hi,
> > >
> > > I have recently configured relayd as SSL accelerator and it is working
> > > really \
> > > great. However it seems that not all http methods that are mentioned
> > > in the man \
> > > page are actually supported by the http protocol.
> > > method name
> > > Match the HTTP request method. The method is specified by name
> > > and can be either CONNECT, COPY, DELETE, GET, HEAD, LOCK, MKCOL,
> > > MOVE, OPTIONS, PATCH, POST, PROPFIND, PROPPATCH, PUT, TRACE, or
> > > UNLOCK.
> > >
> > > The above list is from "man relayd.conf" and I would assume that those
> > > methods, if \
> > > mentioned, are fully supported, however when trying to use Apache2
> > > with mod_dav_svn \
> > > (ap2-subversion) relayd somehow breaks it:
> > > # svn up
> > > svn: Server sent unexpected return value (400 Bad Request) in response
> > > to OPTIONS \
> > > request for 'https://<url>/svn/repo'
> > > This was tested using OpenBSD 5.9. If more information is required,
> > > please say so.
> > >
> > > Regards,
> > > Michael
> > >
> Index: relay_http.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/relayd/relay_http.c,v
> retrieving revision 1.55
> diff -r1.55 relay_http.c
> 375a376
> > default:
> 385,389d385
> < break;
> < default:
> < /* HTTP handler */
> < cre->toread = TOREAD_HTTP_HEADER;
> < bev->readcb = relay_read_http;
--
Paul Fariello
PGP: 0x672CDD2031AAF49B
Index: http.h
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/http.h,v
retrieving revision 1.7
diff -r1.7 http.h
46a47,59
> /* WebDAV versioning Extensions to WebDAV, RFC3253 */
> HTTP_METHOD_VERSION_CONTROL,
> HTTP_METHOD_REPORT,
> HTTP_METHOD_CHECKOUT,
> HTTP_METHOD_CHECKIN,
> HTTP_METHOD_UNCHECKOUT,
> HTTP_METHOD_MKWORKSPACE,
> HTTP_METHOD_UPDATE,
> HTTP_METHOD_LABEL,
> HTTP_METHOD_MERGE,
> HTTP_METHOD_BASELINE_CONTROL,
> HTTP_METHOD_MKACTIVITY,
>
58,75c71,99
< #define HTTP_METHODS { \
< { HTTP_METHOD_GET, "GET" }, \
< { HTTP_METHOD_HEAD, "HEAD" }, \
< { HTTP_METHOD_POST, "POST" }, \
< { HTTP_METHOD_PUT, "PUT" }, \
< { HTTP_METHOD_DELETE, "DELETE" }, \
< { HTTP_METHOD_OPTIONS, "OPTIONS" }, \
< { HTTP_METHOD_TRACE, "TRACE" }, \
< { HTTP_METHOD_CONNECT, "CONNECT" }, \
< { HTTP_METHOD_PROPFIND, "PROPFIND" }, \
< { HTTP_METHOD_PROPPATCH, "PROPPATCH" }, \
< { HTTP_METHOD_MKCOL, "MKCOL" }, \
< { HTTP_METHOD_COPY, "COPY" }, \
< { HTTP_METHOD_MOVE, "MOVE" }, \
< { HTTP_METHOD_LOCK, "LOCK" }, \
< { HTTP_METHOD_UNLOCK, "UNLOCK" }, \
< { HTTP_METHOD_PATCH, "PATCH" }, \
< { HTTP_METHOD_NONE, NULL } \
---
> #define HTTP_METHODS { \
> { HTTP_METHOD_GET, "GET" }, \
> { HTTP_METHOD_HEAD, "HEAD" }, \
> { HTTP_METHOD_POST, "POST" }, \
> { HTTP_METHOD_PUT, "PUT" }, \
> { HTTP_METHOD_DELETE, "DELETE" }, \
> { HTTP_METHOD_OPTIONS, "OPTIONS" }, \
> { HTTP_METHOD_TRACE, "TRACE" }, \
> { HTTP_METHOD_CONNECT, "CONNECT" }, \
> { HTTP_METHOD_PROPFIND, "PROPFIND" }, \
> { HTTP_METHOD_PROPPATCH, "PROPPATCH" }, \
> { HTTP_METHOD_MKCOL, "MKCOL" }, \
> { HTTP_METHOD_COPY, "COPY" }, \
> { HTTP_METHOD_MOVE, "MOVE" }, \
> { HTTP_METHOD_LOCK, "LOCK" }, \
> { HTTP_METHOD_UNLOCK, "UNLOCK" }, \
> { HTTP_METHOD_VERSION_CONTROL, "VERSION_CONTROL" }, \
> { HTTP_METHOD_REPORT, "REPORT" }, \
> { HTTP_METHOD_CHECKOUT, "CHECKOUT" }, \
> { HTTP_METHOD_CHECKIN, "CHECKIN" }, \
> { HTTP_METHOD_UNCHECKOUT, "UNCHECKOUT" }, \
> { HTTP_METHOD_MKWORKSPACE, "MKWORKSPACE" }, \
> { HTTP_METHOD_UPDATE, "UPDATE" }, \
> { HTTP_METHOD_LABEL, "LABEL" }, \
> { HTTP_METHOD_MERGE, "MERGE" }, \
> { HTTP_METHOD_BASELINE_CONTROL, "BASELINE_CONTROL" }, \
> { HTTP_METHOD_MKACTIVITY, "MKACTIVITY" }, \
> { HTTP_METHOD_PATCH, "PATCH" }, \
> { HTTP_METHOD_NONE, NULL } \
Index: relay_http.c
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/relay_http.c,v
retrieving revision 1.55
diff -r1.55 relay_http.c
375a376
> default:
385,389d385
< break;
< default:
< /* HTTP handler */
< cre->toread = TOREAD_HTTP_HEADER;
< bev->readcb = relay_read_http;