1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | const EventEmitter = require('events');
|
17 | const {helper, assert, debugError} = require('./helper');
|
18 | const Multimap = require('./Multimap');
|
19 |
|
20 | class NetworkManager extends EventEmitter {
|
21 | |
22 |
|
23 |
|
24 | constructor(client) {
|
25 | super();
|
26 | this._client = client;
|
27 | this._frameManager = null;
|
28 |
|
29 | this._requestIdToRequest = new Map();
|
30 |
|
31 | this._requestIdToRequestWillBeSentEvent = new Map();
|
32 |
|
33 | this._extraHTTPHeaders = {};
|
34 |
|
35 | this._offline = false;
|
36 |
|
37 |
|
38 | this._credentials = null;
|
39 |
|
40 | this._attemptedAuthentications = new Set();
|
41 | this._userRequestInterceptionEnabled = false;
|
42 | this._protocolRequestInterceptionEnabled = false;
|
43 |
|
44 | this._requestHashToRequestIds = new Multimap();
|
45 |
|
46 | this._requestHashToInterceptionIds = new Multimap();
|
47 |
|
48 | this._client.on('Network.requestWillBeSent', this._onRequestWillBeSent.bind(this));
|
49 | this._client.on('Network.requestIntercepted', this._onRequestIntercepted.bind(this));
|
50 | this._client.on('Network.requestServedFromCache', this._onRequestServedFromCache.bind(this));
|
51 | this._client.on('Network.responseReceived', this._onResponseReceived.bind(this));
|
52 | this._client.on('Network.loadingFinished', this._onLoadingFinished.bind(this));
|
53 | this._client.on('Network.loadingFailed', this._onLoadingFailed.bind(this));
|
54 | }
|
55 |
|
56 | |
57 |
|
58 |
|
59 | setFrameManager(frameManager) {
|
60 | this._frameManager = frameManager;
|
61 | }
|
62 |
|
63 | |
64 |
|
65 |
|
66 | async authenticate(credentials) {
|
67 | this._credentials = credentials;
|
68 | await this._updateProtocolRequestInterception();
|
69 | }
|
70 |
|
71 | |
72 |
|
73 |
|
74 | async setExtraHTTPHeaders(extraHTTPHeaders) {
|
75 | this._extraHTTPHeaders = {};
|
76 | for (const key of Object.keys(extraHTTPHeaders)) {
|
77 | const value = extraHTTPHeaders[key];
|
78 | assert(helper.isString(value), `Expected value of header "${key}" to be String, but "${typeof value}" is found.`);
|
79 | this._extraHTTPHeaders[key.toLowerCase()] = value;
|
80 | }
|
81 | await this._client.send('Network.setExtraHTTPHeaders', { headers: this._extraHTTPHeaders });
|
82 | }
|
83 |
|
84 | |
85 |
|
86 |
|
87 | extraHTTPHeaders() {
|
88 | return Object.assign({}, this._extraHTTPHeaders);
|
89 | }
|
90 |
|
91 | |
92 |
|
93 |
|
94 | async setOfflineMode(value) {
|
95 | if (this._offline === value)
|
96 | return;
|
97 | this._offline = value;
|
98 | await this._client.send('Network.emulateNetworkConditions', {
|
99 | offline: this._offline,
|
100 |
|
101 | latency: 0,
|
102 | downloadThroughput: -1,
|
103 | uploadThroughput: -1
|
104 | });
|
105 | }
|
106 |
|
107 | |
108 |
|
109 |
|
110 | async setUserAgent(userAgent) {
|
111 | await this._client.send('Network.setUserAgentOverride', { userAgent });
|
112 | }
|
113 |
|
114 | |
115 |
|
116 |
|
117 | async setRequestInterception(value) {
|
118 | this._userRequestInterceptionEnabled = value;
|
119 | await this._updateProtocolRequestInterception();
|
120 | }
|
121 |
|
122 | async _updateProtocolRequestInterception() {
|
123 | const enabled = this._userRequestInterceptionEnabled || !!this._credentials;
|
124 | if (enabled === this._protocolRequestInterceptionEnabled)
|
125 | return;
|
126 | this._protocolRequestInterceptionEnabled = enabled;
|
127 | const patterns = enabled ? [{urlPattern: '*'}] : [];
|
128 | await Promise.all([
|
129 | this._client.send('Network.setCacheDisabled', {cacheDisabled: enabled}),
|
130 | this._client.send('Network.setRequestInterception', {patterns})
|
131 | ]);
|
132 | }
|
133 |
|
134 | |
135 |
|
136 |
|
137 | _onRequestWillBeSent(event) {
|
138 | if (this._protocolRequestInterceptionEnabled) {
|
139 | const requestHash = generateRequestHash(event.request);
|
140 | const interceptionId = this._requestHashToInterceptionIds.firstValue(requestHash);
|
141 | if (interceptionId) {
|
142 | this._onRequest(event, interceptionId);
|
143 | this._requestHashToInterceptionIds.delete(requestHash, interceptionId);
|
144 | } else {
|
145 | this._requestHashToRequestIds.set(requestHash, event.requestId);
|
146 | this._requestIdToRequestWillBeSentEvent.set(event.requestId, event);
|
147 | }
|
148 | return;
|
149 | }
|
150 | this._onRequest(event, null);
|
151 | }
|
152 |
|
153 | |
154 |
|
155 |
|
156 | _onRequestIntercepted(event) {
|
157 | if (event.authChallenge) {
|
158 |
|
159 | let response = 'Default';
|
160 | if (this._attemptedAuthentications.has(event.interceptionId)) {
|
161 | response = 'CancelAuth';
|
162 | } else if (this._credentials) {
|
163 | response = 'ProvideCredentials';
|
164 | this._attemptedAuthentications.add(event.interceptionId);
|
165 | }
|
166 | const {username, password} = this._credentials || {username: undefined, password: undefined};
|
167 | this._client.send('Network.continueInterceptedRequest', {
|
168 | interceptionId: event.interceptionId,
|
169 | authChallengeResponse: { response, username, password }
|
170 | }).catch(debugError);
|
171 | return;
|
172 | }
|
173 | if (!this._userRequestInterceptionEnabled && this._protocolRequestInterceptionEnabled) {
|
174 | this._client.send('Network.continueInterceptedRequest', {
|
175 | interceptionId: event.interceptionId
|
176 | }).catch(debugError);
|
177 | }
|
178 |
|
179 | const requestHash = generateRequestHash(event.request);
|
180 | const requestId = this._requestHashToRequestIds.firstValue(requestHash);
|
181 | if (requestId) {
|
182 | const requestWillBeSentEvent = this._requestIdToRequestWillBeSentEvent.get(requestId);
|
183 | this._onRequest(requestWillBeSentEvent, event.interceptionId);
|
184 | this._requestHashToRequestIds.delete(requestHash, requestId);
|
185 | this._requestIdToRequestWillBeSentEvent.delete(requestId);
|
186 | } else {
|
187 | this._requestHashToInterceptionIds.set(requestHash, event.interceptionId);
|
188 | }
|
189 | }
|
190 |
|
191 | |
192 |
|
193 |
|
194 |
|
195 | _onRequest(event, interceptionId) {
|
196 | let redirectChain = [];
|
197 | if (event.redirectResponse) {
|
198 | const request = this._requestIdToRequest.get(event.requestId);
|
199 |
|
200 | if (request) {
|
201 | this._handleRequestRedirect(request, event.redirectResponse);
|
202 | redirectChain = request._redirectChain;
|
203 | }
|
204 | }
|
205 | const frame = event.frameId && this._frameManager ? this._frameManager.frame(event.frameId) : null;
|
206 | const request = new Request(this._client, frame, interceptionId, this._userRequestInterceptionEnabled, event, redirectChain);
|
207 | this._requestIdToRequest.set(event.requestId, request);
|
208 | this.emit(NetworkManager.Events.Request, request);
|
209 | }
|
210 |
|
211 |
|
212 | |
213 |
|
214 |
|
215 | _onRequestServedFromCache(event) {
|
216 | const request = this._requestIdToRequest.get(event.requestId);
|
217 | if (request)
|
218 | request._fromMemoryCache = true;
|
219 | }
|
220 |
|
221 | |
222 |
|
223 |
|
224 |
|
225 | _handleRequestRedirect(request, responsePayload) {
|
226 | const response = new Response(this._client, request, responsePayload);
|
227 | request._response = response;
|
228 | request._redirectChain.push(request);
|
229 | response._bodyLoadedPromiseFulfill.call(null, new Error('Response body is unavailable for redirect responses'));
|
230 | this._requestIdToRequest.delete(request._requestId);
|
231 | this._attemptedAuthentications.delete(request._interceptionId);
|
232 | this.emit(NetworkManager.Events.Response, response);
|
233 | this.emit(NetworkManager.Events.RequestFinished, request);
|
234 | }
|
235 |
|
236 | |
237 |
|
238 |
|
239 | _onResponseReceived(event) {
|
240 | const request = this._requestIdToRequest.get(event.requestId);
|
241 |
|
242 | if (!request)
|
243 | return;
|
244 | const response = new Response(this._client, request, event.response);
|
245 | request._response = response;
|
246 | this.emit(NetworkManager.Events.Response, response);
|
247 | }
|
248 |
|
249 | |
250 |
|
251 |
|
252 | _onLoadingFinished(event) {
|
253 | const request = this._requestIdToRequest.get(event.requestId);
|
254 |
|
255 |
|
256 | if (!request)
|
257 | return;
|
258 |
|
259 |
|
260 |
|
261 | if (request.response())
|
262 | request.response()._bodyLoadedPromiseFulfill.call(null);
|
263 | this._requestIdToRequest.delete(request._requestId);
|
264 | this._attemptedAuthentications.delete(request._interceptionId);
|
265 | this.emit(NetworkManager.Events.RequestFinished, request);
|
266 | }
|
267 |
|
268 | |
269 |
|
270 |
|
271 | _onLoadingFailed(event) {
|
272 | const request = this._requestIdToRequest.get(event.requestId);
|
273 |
|
274 |
|
275 | if (!request)
|
276 | return;
|
277 | request._failureText = event.errorText;
|
278 | const response = request.response();
|
279 | if (response)
|
280 | response._bodyLoadedPromiseFulfill.call(null);
|
281 | this._requestIdToRequest.delete(request._requestId);
|
282 | this._attemptedAuthentications.delete(request._interceptionId);
|
283 | this.emit(NetworkManager.Events.RequestFailed, request);
|
284 | }
|
285 | }
|
286 |
|
287 | class Request {
|
288 | |
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | constructor(client, frame, interceptionId, allowInterception, event, redirectChain) {
|
297 | this._client = client;
|
298 | this._requestId = event.requestId;
|
299 | this._isNavigationRequest = event.requestId === event.loaderId && event.type === 'Document';
|
300 | this._interceptionId = interceptionId;
|
301 | this._allowInterception = allowInterception;
|
302 | this._interceptionHandled = false;
|
303 | this._response = null;
|
304 | this._failureText = null;
|
305 |
|
306 | this._url = event.request.url;
|
307 | this._resourceType = event.type.toLowerCase();
|
308 | this._method = event.request.method;
|
309 | this._postData = event.request.postData;
|
310 | this._headers = {};
|
311 | this._frame = frame;
|
312 | this._redirectChain = redirectChain;
|
313 | for (const key of Object.keys(event.request.headers))
|
314 | this._headers[key.toLowerCase()] = event.request.headers[key];
|
315 |
|
316 | this._fromMemoryCache = false;
|
317 | }
|
318 |
|
319 | |
320 |
|
321 |
|
322 | url() {
|
323 | return this._url;
|
324 | }
|
325 |
|
326 | |
327 |
|
328 |
|
329 | resourceType() {
|
330 | return this._resourceType;
|
331 | }
|
332 |
|
333 | |
334 |
|
335 |
|
336 | method() {
|
337 | return this._method;
|
338 | }
|
339 |
|
340 | |
341 |
|
342 |
|
343 | postData() {
|
344 | return this._postData;
|
345 | }
|
346 |
|
347 | |
348 |
|
349 |
|
350 | headers() {
|
351 | return this._headers;
|
352 | }
|
353 |
|
354 | |
355 |
|
356 |
|
357 | response() {
|
358 | return this._response;
|
359 | }
|
360 |
|
361 | |
362 |
|
363 |
|
364 | frame() {
|
365 | return this._frame;
|
366 | }
|
367 |
|
368 | |
369 |
|
370 |
|
371 | isNavigationRequest() {
|
372 | return this._isNavigationRequest;
|
373 | }
|
374 |
|
375 | |
376 |
|
377 |
|
378 | redirectChain() {
|
379 | return this._redirectChain.slice();
|
380 | }
|
381 |
|
382 | |
383 |
|
384 |
|
385 | failure() {
|
386 | if (!this._failureText)
|
387 | return null;
|
388 | return {
|
389 | errorText: this._failureText
|
390 | };
|
391 | }
|
392 |
|
393 | |
394 |
|
395 |
|
396 | async continue(overrides = {}) {
|
397 | assert(this._allowInterception, 'Request Interception is not enabled!');
|
398 | assert(!this._interceptionHandled, 'Request is already handled!');
|
399 | this._interceptionHandled = true;
|
400 | await this._client.send('Network.continueInterceptedRequest', {
|
401 | interceptionId: this._interceptionId,
|
402 | url: overrides.url,
|
403 | method: overrides.method,
|
404 | postData: overrides.postData,
|
405 | headers: overrides.headers,
|
406 | }).catch(error => {
|
407 |
|
408 |
|
409 | debugError(error);
|
410 | });
|
411 | }
|
412 |
|
413 | |
414 |
|
415 |
|
416 | async respond(response) {
|
417 |
|
418 | if (this._url.startsWith('data:'))
|
419 | return;
|
420 | assert(this._allowInterception, 'Request Interception is not enabled!');
|
421 | assert(!this._interceptionHandled, 'Request is already handled!');
|
422 | this._interceptionHandled = true;
|
423 |
|
424 | const responseBody = response.body && helper.isString(response.body) ? Buffer.from((response.body)) : (response.body || null);
|
425 |
|
426 | const responseHeaders = {};
|
427 | if (response.headers) {
|
428 | for (const header of Object.keys(response.headers))
|
429 | responseHeaders[header.toLowerCase()] = response.headers[header];
|
430 | }
|
431 | if (response.contentType)
|
432 | responseHeaders['content-type'] = response.contentType;
|
433 | if (responseBody && !('content-length' in responseHeaders)) {
|
434 |
|
435 | responseHeaders['content-length'] = Buffer.byteLength(responseBody);
|
436 | }
|
437 |
|
438 | const statusCode = response.status || 200;
|
439 | const statusText = statusTexts[statusCode] || '';
|
440 | const statusLine = `HTTP/1.1 ${statusCode} ${statusText}`;
|
441 |
|
442 | const CRLF = '\r\n';
|
443 | let text = statusLine + CRLF;
|
444 | for (const header of Object.keys(responseHeaders))
|
445 | text += header + ': ' + responseHeaders[header] + CRLF;
|
446 | text += CRLF;
|
447 | let responseBuffer = Buffer.from(text, 'utf8');
|
448 | if (responseBody)
|
449 | responseBuffer = Buffer.concat([responseBuffer, responseBody]);
|
450 |
|
451 | await this._client.send('Network.continueInterceptedRequest', {
|
452 | interceptionId: this._interceptionId,
|
453 | rawResponse: responseBuffer.toString('base64')
|
454 | }).catch(error => {
|
455 |
|
456 |
|
457 | debugError(error);
|
458 | });
|
459 | }
|
460 |
|
461 | |
462 |
|
463 |
|
464 | async abort(errorCode = 'failed') {
|
465 | const errorReason = errorReasons[errorCode];
|
466 | assert(errorReason, 'Unknown error code: ' + errorCode);
|
467 | assert(this._allowInterception, 'Request Interception is not enabled!');
|
468 | assert(!this._interceptionHandled, 'Request is already handled!');
|
469 | this._interceptionHandled = true;
|
470 | await this._client.send('Network.continueInterceptedRequest', {
|
471 | interceptionId: this._interceptionId,
|
472 | errorReason
|
473 | }).catch(error => {
|
474 |
|
475 |
|
476 | debugError(error);
|
477 | });
|
478 | }
|
479 | }
|
480 |
|
481 | const errorReasons = {
|
482 | 'aborted': 'Aborted',
|
483 | 'accessdenied': 'AccessDenied',
|
484 | 'addressunreachable': 'AddressUnreachable',
|
485 | 'blockedbyclient': 'BlockedByClient',
|
486 | 'blockedbyresponse': 'BlockedByResponse',
|
487 | 'connectionaborted': 'ConnectionAborted',
|
488 | 'connectionclosed': 'ConnectionClosed',
|
489 | 'connectionfailed': 'ConnectionFailed',
|
490 | 'connectionrefused': 'ConnectionRefused',
|
491 | 'connectionreset': 'ConnectionReset',
|
492 | 'internetdisconnected': 'InternetDisconnected',
|
493 | 'namenotresolved': 'NameNotResolved',
|
494 | 'timedout': 'TimedOut',
|
495 | 'failed': 'Failed',
|
496 | };
|
497 |
|
498 | helper.tracePublicAPI(Request);
|
499 |
|
500 | class Response {
|
501 | |
502 |
|
503 |
|
504 |
|
505 |
|
506 | constructor(client, request, responsePayload) {
|
507 | this._client = client;
|
508 | this._request = request;
|
509 | this._contentPromise = null;
|
510 |
|
511 | this._bodyLoadedPromise = new Promise(fulfill => {
|
512 | this._bodyLoadedPromiseFulfill = fulfill;
|
513 | });
|
514 |
|
515 | this._remoteAddress = {
|
516 | ip: responsePayload.remoteIPAddress,
|
517 | port: responsePayload.remotePort,
|
518 | };
|
519 | this._status = responsePayload.status;
|
520 | this._statusText = responsePayload.statusText;
|
521 | this._url = request.url();
|
522 | this._fromDiskCache = !!responsePayload.fromDiskCache;
|
523 | this._fromServiceWorker = !!responsePayload.fromServiceWorker;
|
524 | this._headers = {};
|
525 | for (const key of Object.keys(responsePayload.headers))
|
526 | this._headers[key.toLowerCase()] = responsePayload.headers[key];
|
527 | this._securityDetails = responsePayload.securityDetails ? new SecurityDetails(responsePayload.securityDetails) : null;
|
528 | }
|
529 |
|
530 | |
531 |
|
532 |
|
533 | remoteAddress() {
|
534 | return this._remoteAddress;
|
535 | }
|
536 |
|
537 | |
538 |
|
539 |
|
540 | url() {
|
541 | return this._url;
|
542 | }
|
543 |
|
544 | |
545 |
|
546 |
|
547 | ok() {
|
548 | return this._status === 0 || (this._status >= 200 && this._status <= 299);
|
549 | }
|
550 |
|
551 | |
552 |
|
553 |
|
554 | status() {
|
555 | return this._status;
|
556 | }
|
557 |
|
558 | |
559 |
|
560 |
|
561 | statusText() {
|
562 | return this._statusText;
|
563 | }
|
564 |
|
565 | |
566 |
|
567 |
|
568 | headers() {
|
569 | return this._headers;
|
570 | }
|
571 |
|
572 | |
573 |
|
574 |
|
575 | securityDetails() {
|
576 | return this._securityDetails;
|
577 | }
|
578 |
|
579 | |
580 |
|
581 |
|
582 | buffer() {
|
583 | if (!this._contentPromise) {
|
584 | this._contentPromise = this._bodyLoadedPromise.then(async error => {
|
585 | if (error)
|
586 | throw error;
|
587 | const response = await this._client.send('Network.getResponseBody', {
|
588 | requestId: this._request._requestId
|
589 | });
|
590 | return Buffer.from(response.body, response.base64Encoded ? 'base64' : 'utf8');
|
591 | });
|
592 | }
|
593 | return this._contentPromise;
|
594 | }
|
595 |
|
596 | |
597 |
|
598 |
|
599 | async text() {
|
600 | const content = await this.buffer();
|
601 | return content.toString('utf8');
|
602 | }
|
603 |
|
604 | |
605 |
|
606 |
|
607 | async json() {
|
608 | const content = await this.text();
|
609 | return JSON.parse(content);
|
610 | }
|
611 |
|
612 | |
613 |
|
614 |
|
615 | request() {
|
616 | return this._request;
|
617 | }
|
618 |
|
619 | |
620 |
|
621 |
|
622 | fromCache() {
|
623 | return this._fromDiskCache || this._request._fromMemoryCache;
|
624 | }
|
625 |
|
626 | |
627 |
|
628 |
|
629 | fromServiceWorker() {
|
630 | return this._fromServiceWorker;
|
631 | }
|
632 |
|
633 | |
634 |
|
635 |
|
636 | frame() {
|
637 | return this._request.frame();
|
638 | }
|
639 | }
|
640 | helper.tracePublicAPI(Response);
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 | function generateRequestHash(request) {
|
647 | let normalizedURL = request.url;
|
648 | try {
|
649 |
|
650 |
|
651 |
|
652 | normalizedURL = decodeURI(request.url);
|
653 | } catch (e) {
|
654 | }
|
655 | const hash = {
|
656 | url: normalizedURL,
|
657 | method: request.method,
|
658 | postData: request.postData,
|
659 | headers: {},
|
660 | };
|
661 |
|
662 | if (!normalizedURL.startsWith('data:')) {
|
663 | const headers = Object.keys(request.headers);
|
664 | headers.sort();
|
665 | for (let header of headers) {
|
666 | const headerValue = request.headers[header];
|
667 | header = header.toLowerCase();
|
668 | if (header === 'accept' || header === 'referer' || header === 'x-devtools-emulate-network-conditions-client-id' || header === 'cookie')
|
669 | continue;
|
670 | hash.headers[header] = headerValue;
|
671 | }
|
672 | }
|
673 | return JSON.stringify(hash);
|
674 | }
|
675 |
|
676 | class SecurityDetails {
|
677 | |
678 |
|
679 |
|
680 | constructor(securityPayload) {
|
681 | this._subjectName = securityPayload['subjectName'];
|
682 | this._issuer = securityPayload['issuer'];
|
683 | this._validFrom = securityPayload['validFrom'];
|
684 | this._validTo = securityPayload['validTo'];
|
685 | this._protocol = securityPayload['protocol'];
|
686 | }
|
687 |
|
688 | |
689 |
|
690 |
|
691 | subjectName() {
|
692 | return this._subjectName;
|
693 | }
|
694 |
|
695 | |
696 |
|
697 |
|
698 | issuer() {
|
699 | return this._issuer;
|
700 | }
|
701 |
|
702 | |
703 |
|
704 |
|
705 | validFrom() {
|
706 | return this._validFrom;
|
707 | }
|
708 |
|
709 | |
710 |
|
711 |
|
712 | validTo() {
|
713 | return this._validTo;
|
714 | }
|
715 |
|
716 | |
717 |
|
718 |
|
719 | protocol() {
|
720 | return this._protocol;
|
721 | }
|
722 | }
|
723 |
|
724 | NetworkManager.Events = {
|
725 | Request: 'request',
|
726 | Response: 'response',
|
727 | RequestFailed: 'requestfailed',
|
728 | RequestFinished: 'requestfinished',
|
729 | };
|
730 |
|
731 | const statusTexts = {
|
732 | '100': 'Continue',
|
733 | '101': 'Switching Protocols',
|
734 | '102': 'Processing',
|
735 | '200': 'OK',
|
736 | '201': 'Created',
|
737 | '202': 'Accepted',
|
738 | '203': 'Non-Authoritative Information',
|
739 | '204': 'No Content',
|
740 | '206': 'Partial Content',
|
741 | '207': 'Multi-Status',
|
742 | '208': 'Already Reported',
|
743 | '209': 'IM Used',
|
744 | '300': 'Multiple Choices',
|
745 | '301': 'Moved Permanently',
|
746 | '302': 'Found',
|
747 | '303': 'See Other',
|
748 | '304': 'Not Modified',
|
749 | '305': 'Use Proxy',
|
750 | '306': 'Switch Proxy',
|
751 | '307': 'Temporary Redirect',
|
752 | '308': 'Permanent Redirect',
|
753 | '400': 'Bad Request',
|
754 | '401': 'Unauthorized',
|
755 | '402': 'Payment Required',
|
756 | '403': 'Forbidden',
|
757 | '404': 'Not Found',
|
758 | '405': 'Method Not Allowed',
|
759 | '406': 'Not Acceptable',
|
760 | '407': 'Proxy Authentication Required',
|
761 | '408': 'Request Timeout',
|
762 | '409': 'Conflict',
|
763 | '410': 'Gone',
|
764 | '411': 'Length Required',
|
765 | '412': 'Precondition Failed',
|
766 | '413': 'Payload Too Large',
|
767 | '414': 'URI Too Long',
|
768 | '415': 'Unsupported Media Type',
|
769 | '416': 'Range Not Satisfiable',
|
770 | '417': 'Expectation Failed',
|
771 | '418': 'I\'m a teapot',
|
772 | '421': 'Misdirected Request',
|
773 | '422': 'Unprocessable Entity',
|
774 | '423': 'Locked',
|
775 | '424': 'Failed Dependency',
|
776 | '426': 'Upgrade Required',
|
777 | '428': 'Precondition Required',
|
778 | '429': 'Too Many Requests',
|
779 | '431': 'Request Header Fields Too Large',
|
780 | '451': 'Unavailable For Legal Reasons',
|
781 | '500': 'Internal Server Error',
|
782 | '501': 'Not Implemented',
|
783 | '502': 'Bad Gateway',
|
784 | '503': 'Service Unavailable',
|
785 | '504': 'Gateway Timeout',
|
786 | '505': 'HTTP Version Not Supported',
|
787 | '506': 'Variant Also Negotiates',
|
788 | '507': 'Insufficient Storage',
|
789 | '508': 'Loop Detected',
|
790 | '510': 'Not Extended',
|
791 | '511': 'Network Authentication Required',
|
792 | };
|
793 |
|
794 | module.exports = {Request, Response, NetworkManager};
|