Stub handler for hadling create DB on the public API returns HTTP status 412 if the db exists, and 403 if it doesn't. fixes issue #562
()
| 538 | // if the db exists, and 403 if it doesn't. |
| 539 | // fixes issue #562 |
| 540 | func (h *handler) handleCreateTarget() error { |
| 541 | dbname := h.PathVar("targetdb") |
| 542 | if _, err := h.server.GetDatabase(h.ctx(), dbname); err != nil { |
| 543 | return base.HTTPErrorf(http.StatusForbidden, "Creating a DB over the public API is unsupported") |
| 544 | } else { |
| 545 | return base.HTTPErrorf(http.StatusPreconditionFailed, "Database already exists") |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | func (h *handler) handleEFC() error { // Handles _ensure_full_commit. |
| 550 | // no-op. CouchDB's replicator sends this, so don't barf. Status must be 201. |
nothing calls this directly
no test coverage detected