Repository navigation
Commit 6a9c198
fix(editor): the x2t proxy must not fetch a document as if it were a URL
Found reviewing today's changes. Guard 14 turns whatever the vendor
passes into bytes before sending it to the worker, and for strings it
fetched unconditionally. x2t_helper's own handleFileData does not: it
sorts strings into DataURL / BlobURL / FileURL / HttpURL / URL *and*
String, and that last case is not an error -- it encodes the text as
UTF-8 bytes.
So a document handed over as text -- the empty-document template the
offline patch uses, or the latin1 DOCY form of #113 -- would have been
requested as a relative URL instead of converted.
Strings that are not locations now cross untouched, and the worker's own
handleFileData decides, exactly as it did before conversion moved out of
the frame. Same rule for media entries.
looksLikeUrl is exported for the unit test on purpose: it mirrors a
classifier in vendor code that this proxy has to agree with, and getting
it wrong turns a document into a request.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MKNHFQ1kek1cHeqhbH37Pk1 parent 9c347ea commit 6a9c198
2 files changed
Lines changed: 71 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
| |||
211 | 229 | | |
212 | 230 | | |
213 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
214 | 239 | | |
215 | 240 | | |
216 | 241 | | |
| |||
235 | 260 | | |
236 | 261 | | |
237 | 262 | | |
| 263 | + | |
238 | 264 | | |
| 265 | + | |
239 | 266 | | |
240 | 267 | | |
241 | 268 | | |
| |||
281 | 308 | | |
282 | 309 | | |
283 | 310 | | |
284 | | - | |
285 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
286 | 316 | | |
287 | 317 | | |
288 | | - | |
| 318 | + | |
289 | 319 | | |
290 | 320 | | |
291 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments