You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/04/29 17:16:03 UTC

[GitHub] [couchdb-nano] akopchinskiy opened a new issue #156: Referer header required

akopchinskiy opened a new issue #156: Referer header required
URL: https://github.com/apache/couchdb-nano/issues/156
 
 
   <!--- Provide a general summary of the issue in the Title above -->
   ## Code:
   ```ts
   export abstract class CouchDbService {
       private readonly connection = nano(Utils.CouchDbUrlAuth);
       private readonly db: DocumentScope<string>;
   
       constructor(dbName: DB) {
           this.db = this.connection.use(dbName);
       }
   
   ...
   
   let mangoQuery = {
               selector: {
                   _id: {$exists: true}
               },
               fields: ["_id"],
               limit: 50
           };
   
   this.db.find(mangoQuery);
   ```
   
   ## Expected Behavior
   Successful response
   
   ## Current Behavior
   ```json
   {
   "message": "Referer header required.",
   "stack": "Error: Referer header required. at Request._callback (*\node_modules\nano\lib\nano.js:154:15) at Request.self.callback (*\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.EventEmitter.emit (domain.js:441:20) at Request.<anonymous> (*\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Request.EventEmitter.emit (domain.js:441:20) at IncomingMessage.<anonymous> (*\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13)",
   "name": "Error",
   "error": "bad_request",
   "reason": "Referer header required.",
   "scope": "couch",
   "statusCode": 400,
   "request": {
   "method": "POST",
   "headers": {
   "content-type": "application/json",
   "accept": "application/json"
   },
   "uri": "http://XXXXXX:XXXXXX@***/***/_find",
   "body": "{"selector":{"_id":{"$exists":true}},"fields":["_id"],"limit":50}",
   "qsStringifyOptions": {
   "arrayFormat": "repeat"
   }
   },
   "headers": {
   "uri": "http://XXXXXX:XXXXXX@***/***/_find",
   "statusCode": 400,
   "date": "Mon, 29 Apr 2019 17:06:54 GMT",
   "content-type": "application/json",
   "cache-control": "must-revalidate"
   },
   "errid": "non_200",
   "description": "couch returned 400"
   }
   ```
   
   ## Possible Solution
   hz
   
   ## Context
   Trying to make search in CouchDB with MongoBD syntax;
   
   ## Your Environment
   * Version used: 7.0.0
   * Browser Name and version: ?
   * Operating System and version (desktop or mobile): Windows 10
   * Link to your project: Proprietary
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services