Commit 636aaf9
authored
Fix OAuth redirect handling in MCP clients (#630)
* Fix OAuth redirect handling in MCP clients
OAuth callbacks with successRedirect/errorRedirect returned 200 OK
instead of 302 redirects because CORS response reconstruction lost
status codes and headers. Relative URLs also failed since
Response.redirect() requires absolute URLs.
Preserve status/statusText when adding CORS headers, use Headers
constructor to properly copy all headers, and leverage URL
constructor to normalize relative URLs to absolute.
* Fix OAuth redirect handling in MCP clients
* Keep upgrade check1 parent 4487a94 commit 636aaf9
File tree
2 files changed
+28
-12
lines changed- .changeset
- packages/agents/src
2 files changed
+28
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
1669 | 1671 | | |
1670 | | - | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
1671 | 1675 | | |
1672 | 1676 | | |
| 1677 | + | |
1673 | 1678 | | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1677 | 1683 | | |
1678 | 1684 | | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
| 1685 | + | |
| 1686 | + | |
1682 | 1687 | | |
1683 | 1688 | | |
1684 | 1689 | | |
| |||
1755 | 1760 | | |
1756 | 1761 | | |
1757 | 1762 | | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
1758 | 1770 | | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
1763 | 1774 | | |
1764 | 1775 | | |
1765 | 1776 | | |
| |||
0 commit comments