alxndrsn commented on issue #5117:
URL: https://github.com/apache/couchdb/issues/5117#issuecomment-2210358570

   > Can you give a concrete example what’s going wrong?
   
   ### Setup
   
   ```sh
   docker run --detach --network host --rm -e COUCHDB_USER=admin -e 
COUCHDB_PASSWORD=password -it --name my-couchdb-$RANDOM apache/couchdb &&
   sleep 5 &&
   curl http://admin:password@localhost:5984/main -X PUT && curl 
http://admin:password@localhost:5984/_users -X PUT
   ```
   
   ### Create legal doc (PUT)
   
   ```sh
   $ curl http://admin:password@localhost:5984/main/some-valid-doc-id -X PUT -H 
'content-type: application/json' --data '{"hi":true}'
   
{"ok":true,"id":"some-valid-doc-id","rev":"1-e7e9148335bb3e3d0f04263e57edef01"}
   ```
   
   ### Try to create illegal doc (PUT)
   
   ```sh
   $ curl http://admin:password@localhost:5984/main/_bad_path -X PUT -H 
'content-type: application/json' --data '{"hi":true}'
   {"error":"illegal_docid","reason":"Only reserved document ids may start with 
underscore."}
   ```
   
   ### Try to create illegal doc (COPY)
   
   ```sh
   $ curl http://admin:password@localhost:5984/main/some-valid-doc-id -X COPY 
-H 'Destination: _bad_path'
   {"ok":true,"id":"_bad_path","rev":"1-e7e9148335bb3e3d0f04263e57edef01"}
   ```
   
   ### Try to retrieve illegal doc (GET)
   
   ```
   $ curl http://admin:password@localhost:5984/main/_bad_path
   {"_id":"_bad_path","_rev":"1-e7e9148335bb3e3d0f04263e57edef01","hi":true}
   ```
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to