Commit 79462ea
committed
Fix GitHub API endpoint selection based on host parsing
Previously, any provided GitHub URL was treated as a GitHub Enterprise
Server (GHES) instance when selecting the API endpoint. This assumption was
incorrect because the URL can also be for GitHub.com (e.g., https://github.com),
which led to using the wrong API endpoint.
This commit adds a function to extract the host from a URL. This is used to
differentiate between GitHub.com and GHES instances to select the correct
API endpoint.1 parent 602278b commit 79462ea
1 file changed
+50
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
37 | 77 | | |
38 | 78 | | |
39 | 79 | | |
| |||
786 | 826 | | |
787 | 827 | | |
788 | 828 | | |
789 | | - | |
790 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
791 | 839 | | |
792 | 840 | | |
793 | 841 | | |
| |||
0 commit comments