Commit 0e4a588
fix(build): identify the gallery by scheme and host, not string equality
Review pointed out that -ne is case-insensitive, so a source location
differing only in case would pass the check, and suggested -cne.
-cne would be wrong in the other direction. Host names are case-insensitive
by definition, so a strict comparison rejects
https://WWW.PowerShellGallery.com/api/v2 -- which is the real gallery. The
identifying part is the host, and a repository standing in for the gallery
would differ there, not in casing.
The source location is now parsed and its scheme and host compared, which
accepts any casing of the genuine host and rejects a different one.
Unparseable values are rejected too, where the previous string comparison
would have thrown on a null SourceLocation instead.
Verified:
https://www.powershellgallery.com/api/v2 accepted
https://WWW.PowerShellGallery.com/api/V2 accepted
https://evil.example.com/api/v2 rejected
not-a-uri rejected
Unsigned at the author's request -- 1Password is unavailable this session.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G1CarQG8VibNFxw4cN53Zs1 parent 0c77ef4 commit 0e4a588
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
| |||
0 commit comments