couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1144003 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl
Date Thu, 07 Jul 2011 19:47:48 GMT
Author: jan
Date: Thu Jul  7 19:47:48 2011
New Revision: 1144003

URL: http://svn.apache.org/viewvc?rev=1144003&view=rev
Log:
COPY destination header error handling: include check for "https://"

Modified:
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=1144003&r1=1144002&r2=1144003&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Thu Jul  7 19:47:48 2011
@@ -1287,10 +1287,10 @@ parse_copy_destination_header(Req) ->
         undefined ->
             throw({bad_request, "Destination header is mandatory for COPY."});
         Destination ->
-            case Destination of
-                "http://" ++ _Rest ->
+            case re:run(Destination, "^https?://", [{capture, none}]) of
+                match ->
                     throw({bad_request, "Destination URL must be relative."});
-                _Else ->
+                nomatch ->
                 % see if ?rev=revid got appended to the Destination header
                 case re:run(Destination, "\\?", [{capture, none}]) of
                     nomatch ->



Mime
View raw message