[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

1.8.0 bug: Incorrect Accept-Encoding header causes Subversion client to fail to update from Apache httpd behind IIS as reverse proxy.

From: George Schizas <gschizas_at_gmail.com>
Date: Thu, 27 Jun 2013 18:50:19 +0300

When doing an svn checkout (or svn update), on a repo that is served by
Apache httpd with IIS as a reverse proxy (you are connecting to IIS, not
directly Apache), a HTTP 400 error is thrown (really from IIS).

The problem is that the Accept-Encoding header is the following:

gzip;svndiff1;q=0.9,svndiff;q=0.8

But it should be:

gzip,svndiff1;q=0.9,svndiff;q=0.8

or
​perhaps
:

gzip;q=1.0, svndiff1;q=0.9, svndiff;q=0.8

​T​
he difference is that after gzip there should be a comma, not a semicolon.
​ Semicolons are only meant to separate the accepted encoding from the "q"
parameter. Separate encodings are supposed to be separated by commas.​

As it currently stands, it's not a particularly good HTTP header. Obviously
Apache fixes the error silently, but IIS doesn't.

The problem lies in the file subversion/libsvn_ra_serf/update.c, which was
changed in r1436783, by Ivan Zhakov.

There is a workaround, to disable http compression for any server that
exhibits the problem (by setting http-compression = no in the servers file).

The actual solution, is very simple, so, I'm proposing a patch below
​ (it's just one character).​
​ This is
 the first time I'm
​posting to this list
, so
​let me
know if I should also post this to the dev list
​ or anywhere else​
.

Index: subversion/libsvn_ra_serf/update.c
===================================================================
--- subversion/libsvn_ra_serf/update.c (revision 1497385)
+++ subversion/libsvn_ra_serf/update.c (working copy)
@@ -2739,7 +2739,7 @@ setup_update_report_headers(serf_bucket_t *headers
   if (report->sess->using_compression)
     {
       serf_bucket_headers_setn(headers, "Accept-Encoding",
- "gzip;svndiff1;q=0.9,svndiff;q=0.8");
+ "gzip,svndiff1;q=0.9,svndiff;q=0.8");
     }
   else
     {

-- 
George Schizas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Afhse me mono mou, emena kai ton klwno mou
Leave me alone, just me and my clone
Received on 2013-06-27 18:30:32 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.