Commit b7d663f
committed
fix(graphql): fix multipart file upload in CancellableHttpLink
For MultipartRequest, headers must be copied after finalize() is called
because finalize() sets the Content-Type header with the boundary parameter.
Previously headers were copied before finalize(), causing the boundary to be
missing and file uploads to fail.
Also adds comprehensive tests for CancellableHttpLink:
- File upload (multipart) works correctly
- File upload can be cancelled
- Pre-cancelled token immediately fails
- Server errors pass through (not transformed to CancelledException)
- Cancelled request behavior at server level
- Multiple concurrent requests - cancel one, others complete
- Connection reuse verification1 parent c3084a3 commit b7d663f
2 files changed
Lines changed: 461 additions & 6 deletions
File tree
- packages/graphql
- lib/src/links/cancellable_http_link
- test
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 63 | | |
69 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| |||
0 commit comments