Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: script.js
}
[14500] Fix | Delete
this._requests.length = 0;
[14501] Fix | Delete
}
[14502] Fix | Delete
_onError(status) {
[14503] Fix | Delete
this._storedError = createResponseStatusError(status, this._url);
[14504] Fix | Delete
this._headersReceivedCapability.reject(this._storedError);
[14505] Fix | Delete
for (const requestCapability of this._requests) {
[14506] Fix | Delete
requestCapability.reject(this._storedError);
[14507] Fix | Delete
}
[14508] Fix | Delete
this._requests.length = 0;
[14509] Fix | Delete
this._cachedChunks.length = 0;
[14510] Fix | Delete
}
[14511] Fix | Delete
_onProgress(evt) {
[14512] Fix | Delete
this.onProgress?.({
[14513] Fix | Delete
loaded: evt.loaded,
[14514] Fix | Delete
total: evt.lengthComputable ? evt.total : this._contentLength
[14515] Fix | Delete
});
[14516] Fix | Delete
}
[14517] Fix | Delete
get filename() {
[14518] Fix | Delete
return this._filename;
[14519] Fix | Delete
}
[14520] Fix | Delete
get isRangeSupported() {
[14521] Fix | Delete
return this._isRangeSupported;
[14522] Fix | Delete
}
[14523] Fix | Delete
get isStreamingSupported() {
[14524] Fix | Delete
return this._isStreamingSupported;
[14525] Fix | Delete
}
[14526] Fix | Delete
get contentLength() {
[14527] Fix | Delete
return this._contentLength;
[14528] Fix | Delete
}
[14529] Fix | Delete
get headersReady() {
[14530] Fix | Delete
return this._headersReceivedCapability.promise;
[14531] Fix | Delete
}
[14532] Fix | Delete
async read() {
[14533] Fix | Delete
if (this._storedError) {
[14534] Fix | Delete
throw this._storedError;
[14535] Fix | Delete
}
[14536] Fix | Delete
if (this._cachedChunks.length > 0) {
[14537] Fix | Delete
const chunk = this._cachedChunks.shift();
[14538] Fix | Delete
return {
[14539] Fix | Delete
value: chunk,
[14540] Fix | Delete
done: false
[14541] Fix | Delete
};
[14542] Fix | Delete
}
[14543] Fix | Delete
if (this._done) {
[14544] Fix | Delete
return {
[14545] Fix | Delete
value: undefined,
[14546] Fix | Delete
done: true
[14547] Fix | Delete
};
[14548] Fix | Delete
}
[14549] Fix | Delete
const requestCapability = Promise.withResolvers();
[14550] Fix | Delete
this._requests.push(requestCapability);
[14551] Fix | Delete
return requestCapability.promise;
[14552] Fix | Delete
}
[14553] Fix | Delete
cancel(reason) {
[14554] Fix | Delete
this._done = true;
[14555] Fix | Delete
this._headersReceivedCapability.reject(reason);
[14556] Fix | Delete
for (const requestCapability of this._requests) {
[14557] Fix | Delete
requestCapability.resolve({
[14558] Fix | Delete
value: undefined,
[14559] Fix | Delete
done: true
[14560] Fix | Delete
});
[14561] Fix | Delete
}
[14562] Fix | Delete
this._requests.length = 0;
[14563] Fix | Delete
if (this._manager.isPendingRequest(this._fullRequestId)) {
[14564] Fix | Delete
this._manager.abortRequest(this._fullRequestId);
[14565] Fix | Delete
}
[14566] Fix | Delete
this._fullRequestReader = null;
[14567] Fix | Delete
}
[14568] Fix | Delete
}
[14569] Fix | Delete
class PDFNetworkStreamRangeRequestReader {
[14570] Fix | Delete
constructor(manager, begin, end) {
[14571] Fix | Delete
this._manager = manager;
[14572] Fix | Delete
const args = {
[14573] Fix | Delete
onDone: this._onDone.bind(this),
[14574] Fix | Delete
onError: this._onError.bind(this),
[14575] Fix | Delete
onProgress: this._onProgress.bind(this)
[14576] Fix | Delete
};
[14577] Fix | Delete
this._url = manager.url;
[14578] Fix | Delete
this._requestId = manager.requestRange(begin, end, args);
[14579] Fix | Delete
this._requests = [];
[14580] Fix | Delete
this._queuedChunk = null;
[14581] Fix | Delete
this._done = false;
[14582] Fix | Delete
this._storedError = undefined;
[14583] Fix | Delete
this.onProgress = null;
[14584] Fix | Delete
this.onClosed = null;
[14585] Fix | Delete
}
[14586] Fix | Delete
_close() {
[14587] Fix | Delete
this.onClosed?.(this);
[14588] Fix | Delete
}
[14589] Fix | Delete
_onDone(data) {
[14590] Fix | Delete
const chunk = data.chunk;
[14591] Fix | Delete
if (this._requests.length > 0) {
[14592] Fix | Delete
const requestCapability = this._requests.shift();
[14593] Fix | Delete
requestCapability.resolve({
[14594] Fix | Delete
value: chunk,
[14595] Fix | Delete
done: false
[14596] Fix | Delete
});
[14597] Fix | Delete
} else {
[14598] Fix | Delete
this._queuedChunk = chunk;
[14599] Fix | Delete
}
[14600] Fix | Delete
this._done = true;
[14601] Fix | Delete
for (const requestCapability of this._requests) {
[14602] Fix | Delete
requestCapability.resolve({
[14603] Fix | Delete
value: undefined,
[14604] Fix | Delete
done: true
[14605] Fix | Delete
});
[14606] Fix | Delete
}
[14607] Fix | Delete
this._requests.length = 0;
[14608] Fix | Delete
this._close();
[14609] Fix | Delete
}
[14610] Fix | Delete
_onError(status) {
[14611] Fix | Delete
this._storedError = createResponseStatusError(status, this._url);
[14612] Fix | Delete
for (const requestCapability of this._requests) {
[14613] Fix | Delete
requestCapability.reject(this._storedError);
[14614] Fix | Delete
}
[14615] Fix | Delete
this._requests.length = 0;
[14616] Fix | Delete
this._queuedChunk = null;
[14617] Fix | Delete
}
[14618] Fix | Delete
_onProgress(evt) {
[14619] Fix | Delete
if (!this.isStreamingSupported) {
[14620] Fix | Delete
this.onProgress?.({
[14621] Fix | Delete
loaded: evt.loaded
[14622] Fix | Delete
});
[14623] Fix | Delete
}
[14624] Fix | Delete
}
[14625] Fix | Delete
get isStreamingSupported() {
[14626] Fix | Delete
return false;
[14627] Fix | Delete
}
[14628] Fix | Delete
async read() {
[14629] Fix | Delete
if (this._storedError) {
[14630] Fix | Delete
throw this._storedError;
[14631] Fix | Delete
}
[14632] Fix | Delete
if (this._queuedChunk !== null) {
[14633] Fix | Delete
const chunk = this._queuedChunk;
[14634] Fix | Delete
this._queuedChunk = null;
[14635] Fix | Delete
return {
[14636] Fix | Delete
value: chunk,
[14637] Fix | Delete
done: false
[14638] Fix | Delete
};
[14639] Fix | Delete
}
[14640] Fix | Delete
if (this._done) {
[14641] Fix | Delete
return {
[14642] Fix | Delete
value: undefined,
[14643] Fix | Delete
done: true
[14644] Fix | Delete
};
[14645] Fix | Delete
}
[14646] Fix | Delete
const requestCapability = Promise.withResolvers();
[14647] Fix | Delete
this._requests.push(requestCapability);
[14648] Fix | Delete
return requestCapability.promise;
[14649] Fix | Delete
}
[14650] Fix | Delete
cancel(reason) {
[14651] Fix | Delete
this._done = true;
[14652] Fix | Delete
for (const requestCapability of this._requests) {
[14653] Fix | Delete
requestCapability.resolve({
[14654] Fix | Delete
value: undefined,
[14655] Fix | Delete
done: true
[14656] Fix | Delete
});
[14657] Fix | Delete
}
[14658] Fix | Delete
this._requests.length = 0;
[14659] Fix | Delete
if (this._manager.isPendingRequest(this._requestId)) {
[14660] Fix | Delete
this._manager.abortRequest(this._requestId);
[14661] Fix | Delete
}
[14662] Fix | Delete
this._close();
[14663] Fix | Delete
}
[14664] Fix | Delete
}
[14665] Fix | Delete
[14666] Fix | Delete
;// CONCATENATED MODULE: ./src/display/node_stream.js
[14667] Fix | Delete
[14668] Fix | Delete
[14669] Fix | Delete
[14670] Fix | Delete
[14671] Fix | Delete
[14672] Fix | Delete
[14673] Fix | Delete
[14674] Fix | Delete
[14675] Fix | Delete
[14676] Fix | Delete
[14677] Fix | Delete
[14678] Fix | Delete
const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//;
[14679] Fix | Delete
function parseUrl(sourceUrl) {
[14680] Fix | Delete
const url = NodePackages.get("url");
[14681] Fix | Delete
const parsedUrl = url.parse(sourceUrl);
[14682] Fix | Delete
if (parsedUrl.protocol === "file:" || parsedUrl.host) {
[14683] Fix | Delete
return parsedUrl;
[14684] Fix | Delete
}
[14685] Fix | Delete
if (/^[a-z]:[/\\]/i.test(sourceUrl)) {
[14686] Fix | Delete
return url.parse(`file:///${sourceUrl}`);
[14687] Fix | Delete
}
[14688] Fix | Delete
if (!parsedUrl.host) {
[14689] Fix | Delete
parsedUrl.protocol = "file:";
[14690] Fix | Delete
}
[14691] Fix | Delete
return parsedUrl;
[14692] Fix | Delete
}
[14693] Fix | Delete
class PDFNodeStream {
[14694] Fix | Delete
constructor(source) {
[14695] Fix | Delete
this.source = source;
[14696] Fix | Delete
this.url = parseUrl(source.url);
[14697] Fix | Delete
this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:";
[14698] Fix | Delete
this.isFsUrl = this.url.protocol === "file:";
[14699] Fix | Delete
this.httpHeaders = this.isHttp && source.httpHeaders || {};
[14700] Fix | Delete
this._fullRequestReader = null;
[14701] Fix | Delete
this._rangeRequestReaders = [];
[14702] Fix | Delete
}
[14703] Fix | Delete
get _progressiveDataLength() {
[14704] Fix | Delete
return this._fullRequestReader?._loaded ?? 0;
[14705] Fix | Delete
}
[14706] Fix | Delete
getFullReader() {
[14707] Fix | Delete
assert(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once.");
[14708] Fix | Delete
this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this);
[14709] Fix | Delete
return this._fullRequestReader;
[14710] Fix | Delete
}
[14711] Fix | Delete
getRangeReader(start, end) {
[14712] Fix | Delete
if (end <= this._progressiveDataLength) {
[14713] Fix | Delete
return null;
[14714] Fix | Delete
}
[14715] Fix | Delete
const rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end);
[14716] Fix | Delete
this._rangeRequestReaders.push(rangeReader);
[14717] Fix | Delete
return rangeReader;
[14718] Fix | Delete
}
[14719] Fix | Delete
cancelAllRequests(reason) {
[14720] Fix | Delete
this._fullRequestReader?.cancel(reason);
[14721] Fix | Delete
for (const reader of this._rangeRequestReaders.slice(0)) {
[14722] Fix | Delete
reader.cancel(reason);
[14723] Fix | Delete
}
[14724] Fix | Delete
}
[14725] Fix | Delete
}
[14726] Fix | Delete
class BaseFullReader {
[14727] Fix | Delete
constructor(stream) {
[14728] Fix | Delete
this._url = stream.url;
[14729] Fix | Delete
this._done = false;
[14730] Fix | Delete
this._storedError = null;
[14731] Fix | Delete
this.onProgress = null;
[14732] Fix | Delete
const source = stream.source;
[14733] Fix | Delete
this._contentLength = source.length;
[14734] Fix | Delete
this._loaded = 0;
[14735] Fix | Delete
this._filename = null;
[14736] Fix | Delete
this._disableRange = source.disableRange || false;
[14737] Fix | Delete
this._rangeChunkSize = source.rangeChunkSize;
[14738] Fix | Delete
if (!this._rangeChunkSize && !this._disableRange) {
[14739] Fix | Delete
this._disableRange = true;
[14740] Fix | Delete
}
[14741] Fix | Delete
this._isStreamingSupported = !source.disableStream;
[14742] Fix | Delete
this._isRangeSupported = !source.disableRange;
[14743] Fix | Delete
this._readableStream = null;
[14744] Fix | Delete
this._readCapability = Promise.withResolvers();
[14745] Fix | Delete
this._headersCapability = Promise.withResolvers();
[14746] Fix | Delete
}
[14747] Fix | Delete
get headersReady() {
[14748] Fix | Delete
return this._headersCapability.promise;
[14749] Fix | Delete
}
[14750] Fix | Delete
get filename() {
[14751] Fix | Delete
return this._filename;
[14752] Fix | Delete
}
[14753] Fix | Delete
get contentLength() {
[14754] Fix | Delete
return this._contentLength;
[14755] Fix | Delete
}
[14756] Fix | Delete
get isRangeSupported() {
[14757] Fix | Delete
return this._isRangeSupported;
[14758] Fix | Delete
}
[14759] Fix | Delete
get isStreamingSupported() {
[14760] Fix | Delete
return this._isStreamingSupported;
[14761] Fix | Delete
}
[14762] Fix | Delete
async read() {
[14763] Fix | Delete
await this._readCapability.promise;
[14764] Fix | Delete
if (this._done) {
[14765] Fix | Delete
return {
[14766] Fix | Delete
value: undefined,
[14767] Fix | Delete
done: true
[14768] Fix | Delete
};
[14769] Fix | Delete
}
[14770] Fix | Delete
if (this._storedError) {
[14771] Fix | Delete
throw this._storedError;
[14772] Fix | Delete
}
[14773] Fix | Delete
const chunk = this._readableStream.read();
[14774] Fix | Delete
if (chunk === null) {
[14775] Fix | Delete
this._readCapability = Promise.withResolvers();
[14776] Fix | Delete
return this.read();
[14777] Fix | Delete
}
[14778] Fix | Delete
this._loaded += chunk.length;
[14779] Fix | Delete
this.onProgress?.({
[14780] Fix | Delete
loaded: this._loaded,
[14781] Fix | Delete
total: this._contentLength
[14782] Fix | Delete
});
[14783] Fix | Delete
const buffer = new Uint8Array(chunk).buffer;
[14784] Fix | Delete
return {
[14785] Fix | Delete
value: buffer,
[14786] Fix | Delete
done: false
[14787] Fix | Delete
};
[14788] Fix | Delete
}
[14789] Fix | Delete
cancel(reason) {
[14790] Fix | Delete
if (!this._readableStream) {
[14791] Fix | Delete
this._error(reason);
[14792] Fix | Delete
return;
[14793] Fix | Delete
}
[14794] Fix | Delete
this._readableStream.destroy(reason);
[14795] Fix | Delete
}
[14796] Fix | Delete
_error(reason) {
[14797] Fix | Delete
this._storedError = reason;
[14798] Fix | Delete
this._readCapability.resolve();
[14799] Fix | Delete
}
[14800] Fix | Delete
_setReadableStream(readableStream) {
[14801] Fix | Delete
this._readableStream = readableStream;
[14802] Fix | Delete
readableStream.on("readable", () => {
[14803] Fix | Delete
this._readCapability.resolve();
[14804] Fix | Delete
});
[14805] Fix | Delete
readableStream.on("end", () => {
[14806] Fix | Delete
readableStream.destroy();
[14807] Fix | Delete
this._done = true;
[14808] Fix | Delete
this._readCapability.resolve();
[14809] Fix | Delete
});
[14810] Fix | Delete
readableStream.on("error", reason => {
[14811] Fix | Delete
this._error(reason);
[14812] Fix | Delete
});
[14813] Fix | Delete
if (!this._isStreamingSupported && this._isRangeSupported) {
[14814] Fix | Delete
this._error(new AbortException("streaming is disabled"));
[14815] Fix | Delete
}
[14816] Fix | Delete
if (this._storedError) {
[14817] Fix | Delete
this._readableStream.destroy(this._storedError);
[14818] Fix | Delete
}
[14819] Fix | Delete
}
[14820] Fix | Delete
}
[14821] Fix | Delete
class BaseRangeReader {
[14822] Fix | Delete
constructor(stream) {
[14823] Fix | Delete
this._url = stream.url;
[14824] Fix | Delete
this._done = false;
[14825] Fix | Delete
this._storedError = null;
[14826] Fix | Delete
this.onProgress = null;
[14827] Fix | Delete
this._loaded = 0;
[14828] Fix | Delete
this._readableStream = null;
[14829] Fix | Delete
this._readCapability = Promise.withResolvers();
[14830] Fix | Delete
const source = stream.source;
[14831] Fix | Delete
this._isStreamingSupported = !source.disableStream;
[14832] Fix | Delete
}
[14833] Fix | Delete
get isStreamingSupported() {
[14834] Fix | Delete
return this._isStreamingSupported;
[14835] Fix | Delete
}
[14836] Fix | Delete
async read() {
[14837] Fix | Delete
await this._readCapability.promise;
[14838] Fix | Delete
if (this._done) {
[14839] Fix | Delete
return {
[14840] Fix | Delete
value: undefined,
[14841] Fix | Delete
done: true
[14842] Fix | Delete
};
[14843] Fix | Delete
}
[14844] Fix | Delete
if (this._storedError) {
[14845] Fix | Delete
throw this._storedError;
[14846] Fix | Delete
}
[14847] Fix | Delete
const chunk = this._readableStream.read();
[14848] Fix | Delete
if (chunk === null) {
[14849] Fix | Delete
this._readCapability = Promise.withResolvers();
[14850] Fix | Delete
return this.read();
[14851] Fix | Delete
}
[14852] Fix | Delete
this._loaded += chunk.length;
[14853] Fix | Delete
this.onProgress?.({
[14854] Fix | Delete
loaded: this._loaded
[14855] Fix | Delete
});
[14856] Fix | Delete
const buffer = new Uint8Array(chunk).buffer;
[14857] Fix | Delete
return {
[14858] Fix | Delete
value: buffer,
[14859] Fix | Delete
done: false
[14860] Fix | Delete
};
[14861] Fix | Delete
}
[14862] Fix | Delete
cancel(reason) {
[14863] Fix | Delete
if (!this._readableStream) {
[14864] Fix | Delete
this._error(reason);
[14865] Fix | Delete
return;
[14866] Fix | Delete
}
[14867] Fix | Delete
this._readableStream.destroy(reason);
[14868] Fix | Delete
}
[14869] Fix | Delete
_error(reason) {
[14870] Fix | Delete
this._storedError = reason;
[14871] Fix | Delete
this._readCapability.resolve();
[14872] Fix | Delete
}
[14873] Fix | Delete
_setReadableStream(readableStream) {
[14874] Fix | Delete
this._readableStream = readableStream;
[14875] Fix | Delete
readableStream.on("readable", () => {
[14876] Fix | Delete
this._readCapability.resolve();
[14877] Fix | Delete
});
[14878] Fix | Delete
readableStream.on("end", () => {
[14879] Fix | Delete
readableStream.destroy();
[14880] Fix | Delete
this._done = true;
[14881] Fix | Delete
this._readCapability.resolve();
[14882] Fix | Delete
});
[14883] Fix | Delete
readableStream.on("error", reason => {
[14884] Fix | Delete
this._error(reason);
[14885] Fix | Delete
});
[14886] Fix | Delete
if (this._storedError) {
[14887] Fix | Delete
this._readableStream.destroy(this._storedError);
[14888] Fix | Delete
}
[14889] Fix | Delete
}
[14890] Fix | Delete
}
[14891] Fix | Delete
function createRequestOptions(parsedUrl, headers) {
[14892] Fix | Delete
return {
[14893] Fix | Delete
protocol: parsedUrl.protocol,
[14894] Fix | Delete
auth: parsedUrl.auth,
[14895] Fix | Delete
host: parsedUrl.hostname,
[14896] Fix | Delete
port: parsedUrl.port,
[14897] Fix | Delete
path: parsedUrl.path,
[14898] Fix | Delete
method: "GET",
[14899] Fix | Delete
headers
[14900] Fix | Delete
};
[14901] Fix | Delete
}
[14902] Fix | Delete
class PDFNodeStreamFullReader extends BaseFullReader {
[14903] Fix | Delete
constructor(stream) {
[14904] Fix | Delete
super(stream);
[14905] Fix | Delete
const handleResponse = response => {
[14906] Fix | Delete
if (response.statusCode === 404) {
[14907] Fix | Delete
const error = new MissingPDFException(`Missing PDF "${this._url}".`);
[14908] Fix | Delete
this._storedError = error;
[14909] Fix | Delete
this._headersCapability.reject(error);
[14910] Fix | Delete
return;
[14911] Fix | Delete
}
[14912] Fix | Delete
this._headersCapability.resolve();
[14913] Fix | Delete
this._setReadableStream(response);
[14914] Fix | Delete
const getResponseHeader = name => this._readableStream.headers[name.toLowerCase()];
[14915] Fix | Delete
const {
[14916] Fix | Delete
allowRangeRequests,
[14917] Fix | Delete
suggestedLength
[14918] Fix | Delete
} = validateRangeRequestCapabilities({
[14919] Fix | Delete
getResponseHeader,
[14920] Fix | Delete
isHttp: stream.isHttp,
[14921] Fix | Delete
rangeChunkSize: this._rangeChunkSize,
[14922] Fix | Delete
disableRange: this._disableRange
[14923] Fix | Delete
});
[14924] Fix | Delete
this._isRangeSupported = allowRangeRequests;
[14925] Fix | Delete
this._contentLength = suggestedLength || this._contentLength;
[14926] Fix | Delete
this._filename = extractFilenameFromHeader(getResponseHeader);
[14927] Fix | Delete
};
[14928] Fix | Delete
this._request = null;
[14929] Fix | Delete
if (this._url.protocol === "http:") {
[14930] Fix | Delete
const http = NodePackages.get("http");
[14931] Fix | Delete
this._request = http.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse);
[14932] Fix | Delete
} else {
[14933] Fix | Delete
const https = NodePackages.get("https");
[14934] Fix | Delete
this._request = https.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse);
[14935] Fix | Delete
}
[14936] Fix | Delete
this._request.on("error", reason => {
[14937] Fix | Delete
this._storedError = reason;
[14938] Fix | Delete
this._headersCapability.reject(reason);
[14939] Fix | Delete
});
[14940] Fix | Delete
this._request.end();
[14941] Fix | Delete
}
[14942] Fix | Delete
}
[14943] Fix | Delete
class PDFNodeStreamRangeReader extends BaseRangeReader {
[14944] Fix | Delete
constructor(stream, start, end) {
[14945] Fix | Delete
super(stream);
[14946] Fix | Delete
this._httpHeaders = {};
[14947] Fix | Delete
for (const property in stream.httpHeaders) {
[14948] Fix | Delete
const value = stream.httpHeaders[property];
[14949] Fix | Delete
if (value === undefined) {
[14950] Fix | Delete
continue;
[14951] Fix | Delete
}
[14952] Fix | Delete
this._httpHeaders[property] = value;
[14953] Fix | Delete
}
[14954] Fix | Delete
this._httpHeaders.Range = `bytes=${start}-${end - 1}`;
[14955] Fix | Delete
const handleResponse = response => {
[14956] Fix | Delete
if (response.statusCode === 404) {
[14957] Fix | Delete
const error = new MissingPDFException(`Missing PDF "${this._url}".`);
[14958] Fix | Delete
this._storedError = error;
[14959] Fix | Delete
return;
[14960] Fix | Delete
}
[14961] Fix | Delete
this._setReadableStream(response);
[14962] Fix | Delete
};
[14963] Fix | Delete
this._request = null;
[14964] Fix | Delete
if (this._url.protocol === "http:") {
[14965] Fix | Delete
const http = NodePackages.get("http");
[14966] Fix | Delete
this._request = http.request(createRequestOptions(this._url, this._httpHeaders), handleResponse);
[14967] Fix | Delete
} else {
[14968] Fix | Delete
const https = NodePackages.get("https");
[14969] Fix | Delete
this._request = https.request(createRequestOptions(this._url, this._httpHeaders), handleResponse);
[14970] Fix | Delete
}
[14971] Fix | Delete
this._request.on("error", reason => {
[14972] Fix | Delete
this._storedError = reason;
[14973] Fix | Delete
});
[14974] Fix | Delete
this._request.end();
[14975] Fix | Delete
}
[14976] Fix | Delete
}
[14977] Fix | Delete
class PDFNodeStreamFsFullReader extends BaseFullReader {
[14978] Fix | Delete
constructor(stream) {
[14979] Fix | Delete
super(stream);
[14980] Fix | Delete
let path = decodeURIComponent(this._url.path);
[14981] Fix | Delete
if (fileUriRegex.test(this._url.href)) {
[14982] Fix | Delete
path = path.replace(/^\//, "");
[14983] Fix | Delete
}
[14984] Fix | Delete
const fs = NodePackages.get("fs");
[14985] Fix | Delete
fs.promises.lstat(path).then(stat => {
[14986] Fix | Delete
this._contentLength = stat.size;
[14987] Fix | Delete
this._setReadableStream(fs.createReadStream(path));
[14988] Fix | Delete
this._headersCapability.resolve();
[14989] Fix | Delete
}, error => {
[14990] Fix | Delete
if (error.code === "ENOENT") {
[14991] Fix | Delete
error = new MissingPDFException(`Missing PDF "${path}".`);
[14992] Fix | Delete
}
[14993] Fix | Delete
this._storedError = error;
[14994] Fix | Delete
this._headersCapability.reject(error);
[14995] Fix | Delete
});
[14996] Fix | Delete
}
[14997] Fix | Delete
}
[14998] Fix | Delete
class PDFNodeStreamFsRangeReader extends BaseRangeReader {
[14999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function