couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Parker <michael.g.par...@gmail.com>
Subject Re: Referer header required for POST requests?
Date Thu, 29 Mar 2012 21:07:30 GMT
So I put a "foo.org" value there, and got the message "Referer header
must match host." Reading up, Host is a required field for HTTP 1.1,
but the bulk insert API with HTTP 1.1 actually works fine without it.

So I mapped foo.org to localhost in my hosts file, and for this request:

POST /test_db/10 HTTP/1.1
Connection: keep-alive
Content-Type: application/json
Host: foo.org
Referer: foo.org
Content-Length: 198

I still see the response:

{"error":"bad_request","reason":"Referer header must match host."}

I'm probably misunderstanding how the hosts file works or would help,
or I'm misunderstanding the error reason. Any help would be greatly
appreciated!

Thanks,
Mike


On Thu, Mar 29, 2012 at 1:47 PM, Robert Newson <rnewson@apache.org> wrote:
> I believe it's a security thing, to stop cross-posting.
>
> On 29 March 2012 21:40, Michael Parker <michael.g.parker@gmail.com> wrote:
>> Hi all,
>>
>> I'm writing a load test tool for CouchDB (coming soon, will be open
>> sourced, will announce it here, yada yada :) and when trying to insert
>> a document with a HTTP request like so:
>>
>> POST /test_db/10 HTTP/1.1
>> Connection: keep-alive
>> Content-Type: application/json
>> Content-Length: 168
>>
>> I get the reply:
>>
>> {"error":"bad_request","reason":"Referer header required."}
>>
>> Why is the referrer header required? Furthermore, for a standalone
>> tool like this, what's an appropriate value? I couldn't find any
>> mention of this header at
>> http://wiki.apache.org/couchdb/HTTP_Document_API#POST. I'm using Couch
>> 1.1.1.
>>
>> Thanks,
>> Mike

Mime
View raw message