MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / constructor

Method constructor

utils/upload.ts:192–208  ·  view source on GitHub ↗
(private xhr: XMLHttpRequest)

Source from the content-addressed store, hash-verified

190 url: string;
191
192 constructor(private xhr: XMLHttpRequest) {
193 this.status = xhr.status;
194 this.statusText = xhr.statusText;
195 this.url = xhr.responseURL;
196 this.ok = this.status >= 200 && this.status < 300;
197 this.headers = new Headers();
198
199 const rawHeaders = xhr.getAllResponseHeaders();
200 for (const line of rawHeaders.trim().split(/[\r\n]+/)) {
201 if (!line) continue;
202
203 const separatorIndex = line.indexOf(":");
204 if (separatorIndex < 0) continue;
205
206 this.headers.append(line.slice(0, separatorIndex).trim(), line.slice(separatorIndex + 1).trim());
207 }
208 }
209
210 async text(): Promise<string> {
211 return typeof this.xhr.response === "string"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected