Commit 2d7cd7e
Forward getScriptSource with no fetchable URL (#58625)
Summary:
The proxy intercepted every `Debugger.getScriptSource` request and tried to fetch the URL it had recorded for the script, failing closed on an empty or non-HTTP one. Scripts compiled from debug client expressions (e.g. code typed into the DevTools console) report an empty `url`, so requesting their source failed even once the target can serve it.
The proxy now forwards the request to the target when it has no HTTP(S) URL of its own to fetch, and relays the target's response back. Proxy-side serving is unchanged: with a fetchable URL the proxy still answers itself, and it still never reads local files.
Changelog:
[GENERAL] [FIXED] - Fix "Unable to fetch script source" when debugging code evaluated in the DevTools console
Differential Revision: D1210013931 parent f03f6c2 commit 2d7cd7e
2 files changed
Lines changed: 85 additions & 26 deletions
File tree
- packages/dev-middleware/src
- __tests__
- inspector-proxy
Lines changed: 64 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
473 | | - | |
474 | | - | |
| 474 | + | |
| 475 | + | |
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
| |||
495 | 496 | | |
496 | 497 | | |
497 | 498 | | |
498 | | - | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
504 | 508 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | 509 | | |
515 | | - | |
516 | | - | |
517 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
518 | 513 | | |
519 | | - | |
520 | | - | |
521 | | - | |
| 514 | + | |
| 515 | + | |
522 | 516 | | |
523 | 517 | | |
524 | 518 | | |
525 | 519 | | |
526 | 520 | | |
527 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
528 | 574 | | |
529 | 575 | | |
530 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
956 | 962 | | |
957 | 963 | | |
958 | 964 | | |
| |||
1038 | 1044 | | |
1039 | 1045 | | |
1040 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1041 | 1056 | | |
1042 | 1057 | | |
1043 | 1058 | | |
| |||
1077 | 1092 | | |
1078 | 1093 | | |
1079 | 1094 | | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1080 | 1101 | | |
1081 | 1102 | | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | 1103 | | |
1091 | 1104 | | |
1092 | 1105 | | |
| |||
0 commit comments