Describe the bug
client.getQuota() returns two numbers that are not the real available or used quota of the user. These two numbers are from two separated entries of the PROPFIND command issued inside the getQuota() call.
To Reproduce
Steps to reproduce the behavior:
- create a user with a specific quota, an fill in some files and folders
- get the quota of that user:
const ncc = require( 'nextcloud-node-client');
const server_data = { basicAuth: { username: auth.username, password: auth.password }, url: server_url, };
const server = new ncc.Server( server_data );
const client = new ncc.Client( server);
const user_quota = await client.getQuota();
Correction
after looking into the code:
public async getQuota(): Promise<IQuota> {
log.debug("getQuota");
const requestInit: RequestInit = {
method: "PROPFIND",
};
const response: Response = await this.getHttpResponse(this.webDAVUrl + "/", requestInit, [207], { description: "Client get quota" });
...
In requestInit it seems that headers: new node_fetch_1.Headers({ "Depth": "0" }), is missing.
With
const requestInit: RequestInit = {
method: "PROPFIND",
headers: new node_fetch_1.Headers({ "Depth": "0" }),
};
it returns the expected result.
client_patch.txt
Describe the bug
client.getQuota() returns two numbers that are not the real available or used quota of the user. These two numbers are from two separated entries of the PROPFIND command issued inside the getQuota() call.
To Reproduce
Steps to reproduce the behavior:
Correction
after looking into the code:
In
requestInitit seems thatheaders: new node_fetch_1.Headers({ "Depth": "0" }),is missing.With
it returns the expected result.
client_patch.txt