fix: Windows integration add-to-hfs not working when only https is available #1030

Massimo Melina committed Jun 27, 2025 at 20:26 UTC 193e392fde25c097f4ac98fb8f0c478f186e26e3
1 file changed +2 -1
src/api.vfs.ts
+2 -1
@@ -243,7 +243,8 @@ const apis: ApiHandlers = {
243 await reg('add', WINDOWS_REG_KEY.replace('*', k) + '\\command', '/ve', '/f', '/d', `powershell -WindowStyle Hidden -Command "
244 $wsh = New-Object -ComObject Wscript.Shell;
245 $j = @{parent=@'\n${parent}\n'@; source=@'\n%1\n'@} | ConvertTo-Json -Compress
246 - $j = [System.Text.Encoding]::UTF8.GetBytes($j);
246 + $j = [System.Text.Encoding]::UTF8.GetBytes($j);
247 + [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
248 try {
249 $res = Invoke-WebRequest -Uri '${url}/~/api/add_vfs' -Method POST -Headers @{ 'x-hfs-anti-csrf' = '1' } -ContentType 'application/json' -TimeoutSec 2 -Body $j;
250 $json = $res.Content | ConvertFrom-Json; $link = $json.link; $link | Set-Clipboard;