Просмотр исходного кода

quote plus in filenames to work around a bug in the S3 server
(LP: #1003633)

Michael Vogt лет назад: 13
Родитель
Сommit
1d12857c08
2 измененных файлов с 7 добавлено и 1 удалено
  1. 2 0
      debian/changelog
  2. 5 1
      methods/http.cc

+ 2 - 0
debian/changelog

@@ -26,6 +26,8 @@ apt (0.9.7.8) UNRELEASED; urgency=low
       (potentially) used for non deb,dsc content that may contain
       (potentially) used for non deb,dsc content that may contain
       spaces, thanks to Daniel Hartwig and Thomas Bushnell 
       spaces, thanks to Daniel Hartwig and Thomas Bushnell 
       (LP: #1086997)
       (LP: #1086997)
+    - quote plus in filenames to work around a bug in the S3 server
+      (LP: #1003633)
 
 
  -- Christian Perrier <bubulle@debian.org>  Mon, 24 Dec 2012 07:01:20 +0100
  -- Christian Perrier <bubulle@debian.org>  Mon, 24 Dec 2012 07:01:20 +0100
 
 

+ 5 - 1
methods/http.cc

@@ -685,8 +685,12 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
       pass it on, HTTP/1.1 says the connection should default to keep alive
       pass it on, HTTP/1.1 says the connection should default to keep alive
       and we expect the proxy to do this */
       and we expect the proxy to do this */
    if (Proxy.empty() == true || Proxy.Host.empty())
    if (Proxy.empty() == true || Proxy.Host.empty())
+   {
+      // see LP bugs #1003633 and #1086997. The "+" is encoded as a workaround
+      // for a amazon S3 bug
       sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
       sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
-	      QuoteString(Uri.Path,"~ ").c_str(),ProperHost.c_str());
+	      QuoteString(Uri.Path,"+~ ").c_str(),ProperHost.c_str());
+   }
    else
    else
    {
    {
       /* Generate a cache control header if necessary. We place a max
       /* Generate a cache control header if necessary. We place a max