diff --git a/.github/workflows/e2e-desktop.yml b/.github/workflows/e2e-desktop.yml index 50d1f396..5d580236 100644 --- a/.github/workflows/e2e-desktop.yml +++ b/.github/workflows/e2e-desktop.yml @@ -127,6 +127,26 @@ jobs: xvfb-run --auto-servernum pnpm test:e2e ' + - name: Install matching EdgeDriver (Windows) + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + # Tauri uses the WebView2 runtime, not Edge directly. + # msedgedriver must match the WebView2 runtime version, not the Edge browser version. + $wv2Key = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' + if (-not (Test-Path $wv2Key)) { $wv2Key = 'HKLM:\SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}' } + $wv2Version = (Get-ItemProperty $wv2Key).pv + Write-Host "WebView2 runtime version: $wv2Version" + $driverUrl = "https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/$wv2Version/edgedriver_win64.zip" + $zipPath = "$env:TEMP\edgedriver.zip" + $extractDir = "$env:TEMP\edgedriver" + Invoke-WebRequest -Uri $driverUrl -OutFile $zipPath + Expand-Archive -Path $zipPath -DestinationPath $extractDir -Force + $driverDir = "$extractDir\edgedriver_win64" + if (-not (Test-Path "$driverDir\msedgedriver.exe")) { $driverDir = $extractDir } + Write-Host "EdgeDriver path: $driverDir" + echo "$driverDir" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH + - name: Run desktop E2E tests (Windows) if: matrix.os == 'windows-latest' run: pnpm test:e2e diff --git a/crates/mcpmux-gateway/src/pool/transport/http.rs b/crates/mcpmux-gateway/src/pool/transport/http.rs index 250f0046..af157740 100644 --- a/crates/mcpmux-gateway/src/pool/transport/http.rs +++ b/crates/mcpmux-gateway/src/pool/transport/http.rs @@ -94,6 +94,7 @@ impl HttpTransport { "access token", "missing or invalid", "bearer", + "unexpected content type", ]; oauth_indicators.iter().any(|s| error_lower.contains(s)) } @@ -845,6 +846,13 @@ mod tests { assert!(HttpTransport::requires_oauth("transport channel closed")); } + #[test] + fn test_requires_oauth_unexpected_content_type() { + assert!(HttpTransport::requires_oauth( + "Unexpected content type: Some(\"text/plain;charset=UTF-8\")" + )); + } + #[test] fn test_requires_oauth_false_for_unrelated() { assert!(!HttpTransport::requires_oauth("connection refused"));