1

I'm working with CouchDB and am trying to search a db using _find. I am currently running into the following error:

  error: 'bad_request',
  reason: 'Referer header must match host.',
  scope: 'couch',
  statusCode: 400,
  request:
   { method: 'POST',
     headers:
      { 'content-type': 'application/json',
        accept: 'application/json',
        Host: 'https://example.com',
        Referer: 'https://example.com' },
     uri: 'http://XXXXXX:XXXXXX@206.189.178.130:5984/gc_common/_find',
     body: '{"selector":{"_id":"taglist"}}' },
  headers:
   { date: 'Wed, 24 Jul 2019 01:58:37 GMT',
     'content-type': 'application/json',
     connection: 'close',
     'cache-control': 'must-revalidate',
     statusCode: 400,
     uri: 'http://XXXXXX:XXXXXX@206.189.178.130:5984/gc_common/_find' },
  errid: 'non_200',
  description: 'couch returned 400' }
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
  • At first glance I see that the `Host` header contains an URI but it should only contain the host name ("example.com" without leading "https://"). – uminder Jul 24 '19 at 07:03
  • That actually does fix the original error, but leaves me with another one: "Only reserved document ids may start with underscore." – Nathanael Troyer Jul 24 '19 at 21:15
  • Since this new problem is not directly related to the original error, you better post an independent new question. – uminder Jul 25 '19 at 05:50
  • Ok, here's a link to the new question: https://stackoverflow.com/questions/57210714/couchdb-nano-only-reserved-document-ids-may-start-with-underscore-when-tryi – Nathanael Troyer Jul 25 '19 at 22:09

0 Answers0