Commit 95e94d3
Fix integration proxy endpoint to properly forward upstream error status codes
Fixes SENTRY-5K7H
When the integration proxy endpoint (Relay's forward endpoint) forwards
requests to upstream services like GitHub and those services return error
status codes (e.g. 403 Forbidden due to IP allow-list restrictions),
Relay was converting those errors to 500 Internal Server Error responses
instead of passing through the actual status code.
The root cause was in `UpstreamRequestError::IntoResponse` where the
wildcard catch-all `_ => StatusCode::INTERNAL_SERVER_ERROR` was matching
`ResponseError(status, _)` and `RateLimited(_)` variants, discarding the
actual upstream status code.
Fix: Explicitly handle `ResponseError` and `RateLimited` before the
wildcard so that:
- `ResponseError(status, _)` returns the actual upstream HTTP status code
- `RateLimited(_)` returns 429 Too Many Requests
- Internal errors (`NoCredentials`, `ChannelClosed`, `AuthDenied`) still
return 500 via the wildcard
Co-authored-by: JoshFerge <1976777+JoshFerge@users.noreply.github.com>1 parent 5b0864d commit 95e94d3
File tree
2 files changed
+28
-0
lines changed- relay-server/src/services
- tests/integration
2 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
0 commit comments