newTransport returns an HTTP transport with automatic gzip compression disabled and using Docker Desktop proxy if available.
(ctx context.Context)
| 173 | |
| 174 | // newTransport returns an HTTP transport with automatic gzip compression disabled and using Docker Desktop proxy if available. |
| 175 | func newTransport(ctx context.Context) http.RoundTripper { |
| 176 | // Get the base transport with Desktop proxy support from remote package |
| 177 | rt := remote.NewTransport(ctx) |
| 178 | |
| 179 | // Disable compression for SSE streaming compatibility |
| 180 | // Handle both direct *http.Transport and the fallback transport wrapper |
| 181 | switch t := rt.(type) { |
| 182 | case *http.Transport: |
| 183 | t.DisableCompression = true |
| 184 | case interface{ DisableCompression() }: |
| 185 | t.DisableCompression() |
| 186 | } |
| 187 | |
| 188 | return rt |
| 189 | } |
| 190 | |
| 191 | type userAgentTransport struct { |
| 192 | httpOptions HTTPOptions |