Commit 0f43b2c
committed
Fall through sharedPrefetch when proxy returns non-2xx
Joe says: What Claude says below is accurate, no more notes on functionality
Emmanuel had reported an issue with loading shared images and shared programs
on pyret.bootstrapworld.org.
There was indeed a problem where the proxy for shared URLs could report
failures *from the proxy* when the file had actually been published or added on
PBO. This fixes that issue with the "proxy back to CPO for legacy share URLs"
feature.
Claude says:
The /shared-image-contents, /shared-program-contents, and /shared-file
endpoints try the SHARED_FETCH_SERVER proxy first and fall back to a
local Drive fetch on failure. sharedPrefetch was resolving on any HTTP
response from the upstream, including 4xx, which meant the upstream's
error body got piped straight back to the client — the local fallback
never ran.
For shares minted on this deploy and unknown to the proxy server (e.g.,
PBO or pyret-horizon proxying through CPO), this turned every fetch into
a 400 "Could not access shared file" instead of falling through to the
local fetch where it would have succeeded.
Only resolve sharedPrefetch on 2xx; abort the in-flight request and
reject otherwise, so the existing .fail handlers do their job.1 parent b2a67fc commit 0f43b2c
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
864 | | - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
865 | 877 | | |
866 | 878 | | |
867 | 879 | | |
| |||
0 commit comments