Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: Yusuke Sakurai <[email protected]>
  • Loading branch information
github-actions[bot] and keroxp authored May 5, 2020
1 parent 8910729 commit bfff56d
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .denov
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.40.0
v0.42.0
8 changes: 4 additions & 4 deletions couch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class CouchDatabase<T> {
const res = await this.fetch(`/${id}`, {
method: "HEAD",
});
res.body.close();
await res.text();
if (res.status === 200 || res.status === 304) {
return res.headers;
} else if (res.status === 404) {
Expand Down Expand Up @@ -384,7 +384,7 @@ class CouchDatabase<T> {
accept: "application/json",
}),
});
res.body.close();
await res.text();
if (res.status === 200) {
return res.headers;
} else if (res.status === 404) {
Expand Down Expand Up @@ -436,7 +436,7 @@ class CouchDatabase<T> {
}
// TODO: use ReadableStream if possible
const buf = new Buffer();
await copy(buf, data);
await copy(data, buf);
const res = await this.fetch(`/${id}/${attachment}?${params.toString()}`, {
method: "PUT",
headers,
Expand Down Expand Up @@ -556,7 +556,7 @@ export class CouchClient {
// DB
async databaseExists(name: string): Promise<boolean> {
const res = await this.fetch(`/${name}`, { method: "HEAD" });
res.body.close();
await res.text();
if (res.status === 200) {
return true;
} else if (res.status === 404) {
Expand Down
Loading

0 comments on commit bfff56d

Please sign in to comment.