Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D0141007F for ; Tue, 28 Apr 2015 13:00:10 +0000 (UTC) Received: (qmail 80040 invoked by uid 500); 28 Apr 2015 13:00:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 79983 invoked by uid 500); 28 Apr 2015 13:00:09 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 79964 invoked by uid 99); 28 Apr 2015 13:00:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 13:00:09 +0000 Date: Tue, 28 Apr 2015 13:00:09 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-2673) "Location" header in HTTP response should properly encode the document _id MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-2673?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D14= 516989#comment-14516989 ]=20 ASF GitHub Bot commented on COUCHDB-2673: ----------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/couchdb/pull/314 > "Location" header in HTTP response should properly encode the document _i= d > -------------------------------------------------------------------------= - > > Key: COUCHDB-2673 > URL: https://issues.apache.org/jira/browse/COUCHDB-2673 > Project: CouchDB > Issue Type: Bug > Security Level: public(Regular issues)=20 > Components: HTTP Interface > Affects Versions: 1.6.1 > Reporter: Samuel Tardieu > > When inserting a document in a CouchDB 1.6.1 database, the response sent = by CouchDB contains a "Location" HTTP header with the URI of the newly crea= ted document. > However, if the "_id" of the new document contains non-ASCII characters, = this "Location" header is not properly encoded. > Example: > {code} > % curl -v -H "Content-Type: application/json" -X POST http://localhost:5= 984/test/ --data '{"_id": "xxx=C3=A9"}' > * Trying ::1... > * Connected to localhost (::1) port 5984 (#0) > > POST /test/ HTTP/1.1 > > Host: localhost:5984 > > User-Agent: curl/7.42.0 > > Accept: */* > > Content-Type: application/json > > Content-Length: 16 > >=20 > * upload completely sent off: 16 out of 16 bytes > < HTTP/1.1 201 Created > < Server: CouchDB/1.6.1 (Erlang OTP/17) > < Location: http://localhost:5984/test/xxx=C3=A9 > < ETag: "1-967a00dff5e02add41819138abb3284d" > < Date: Sat, 25 Apr 2015 21:33:04 GMT > < Content-Type: text/plain; charset=3Dutf-8 > < Content-Length: 68 > < Cache-Control: must-revalidate > <=20 > {"ok":true,"id":"xxx=C3=A9","rev":"1-967a00dff5e02add41819138abb3284d"} > {code} > According to RFC 2616 ("HTTP headers only contain ASCII") and RFC 2396 ("= here is how to construct an URI from ASCII characters"), the "Location" hea= der should be formatted as: > {code} > Location: http://localhost:5984/test/xxx%C3%A9 > {code} > The "spray.io" framework warns against this invalid response when doing s= uch a request towards a CouchDB database. -- This message was sent by Atlassian JIRA (v6.3.4#6332)