feat: Require UUID token authorization for /shutdown endpoint
This commit is contained in:
1 parent
53dce890ec
commit
ce17ffcf42
3 files changed
+69
-32
No files matched your search
+6
-1
@@ -1,6 +1,11 @@
|
||||
try {
|
||||
Write-Host "Gracefully shutting down server..."
|
||||
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:3000/shutdown" -ErrorAction SilentlyContinue
|
||||
$tokenPath = "C:\Users\reazul.ashraf\.gemini\mcp_memory\admin.token"
|
||||
$headers = @{}
|
||||
if (Test-Path $tokenPath) {
|
||||
$headers["Authorization"] = "Bearer $(Get-Content -Path $tokenPath -Raw)".Trim()
|
||||
}
|
||||
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:3000/shutdown" -Headers $headers -ErrorAction SilentlyContinue | Out-Null
|
||||
Start-Sleep -Seconds 2
|
||||
} catch {
|
||||
Write-Host "Server might already be down or unreachable."
|
||||
|
||||
Reference in new issue
Block a user