This repository was archived by the owner on Aug 15, 2019. It is now read-only.
Commit c1781ee
Nikhil Thorat
Undo change where we add an arraybuffer response type to the re… (#1848)
BUG
TLDR: we added a request header in core which changes how CORS interacts with GCP.
Longer story:
This change added a "responseType: arrayBuffer" header so that react native would be happy:
https://github.com/tensorflow/tfjs-core/pull/1789/files#diff-5c8893bf31b1cd319675fcf3524961e8
When browsers see custom request headers they make an initial request of type OPTIONS which allows the server to respond saying that they will accept the next GET request. If the OPTIONS request fails, the GET request never happens for the weights.
It turns out you have to do some more configuration on GCP to allow OPTIONS requests through.
As a quick fix, we just changed our GCP settings for tfjs-models. However, this problem will still show up for anyone hosting their own models (without custom server config stuff). So I'm going to undo the change from the PR above as a permanent solution and we'll send the request header just for react native (which treats these things differently).
Fixes tensorflow/tfjs#17551 parent ae1dd4a commit c1781ee
2 files changed
+2
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 45 | | |
53 | 46 | | |
54 | | - | |
| 47 | + | |
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 439 | + | |
443 | 440 | | |
444 | 441 | | |
445 | 442 | | |
| |||
0 commit comments