couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: svn commit: r758723 - in /couchdb/trunk: share/www/script/test/basics.js src/couchdb/couch_httpd_db.erl
Date Thu, 26 Mar 2009 17:47:17 GMT
On 26.03.2009, at 17:28, jan@apache.org wrote:
> Author: jan
> Date: Thu Mar 26 16:28:21 2009
> New Revision: 758723
>
> URL: http://svn.apache.org/viewvc?rev=758723&view=rev
> Log:
> return Location header for newly create databases

[snip]

> Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
> URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=758723&r1=758722&r2=758723&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
> +++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Thu Mar 26 16:28:21  
> 2009
> @@ -56,7 +56,7 @@
>     case couch_server:create(DbName, [{user_ctx, UserCtx}]) of
>     {ok, Db} ->
>         couch_db:close(Db),
> -        send_json(Req, 201, {[{ok, true}]});
> +        send_json(Req, 201, [{"Location", "/" ++ DbName}], {[{ok,  
> true}]});
>     Error ->
>         throw(Error)
>     end.

The Location header value should be an absolute URI including schema  
and host. I think there's a function somewhere in couch_httpd.erl to  
make relative URIs absolute.

Cheers,
-- 
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


Mime
View raw message