bevy/crates
Rob Parrett ecd276db4b Fix missing meta files breaking Bevy on itch (#19268)
# Objective

Fixes #19029 (also maybe sorta #18002, but we may want to handle the SPA
issue I outlined there more gracefully?)


## Solution

The most minimal / surgical approach I could think of, hopefully
cherry-pickable for a point release.

It seems that it's not *entirely* crazy for web services to return 403
for an item that was not found. Here's an example from [Amazon
CloudFront
docs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-403-permission-denied.html#s3-origin-403-error).
If it is somewhat common for web services to behave this way, then I
think it's best to also treat these responses as if they were "not
found."

I was previously of the opinion that any 400 level error "might as well"
get this treatment, but I'm now thinking that's probably overkill and
there are quite a few 400 level statuses that would indicate some
problem that needs to be fixed, and interpreting these as "not found"
might add confusion to the debugging process.

## Testing

Tested this with a web server that returns 403 for requests to meta
files.

```bash
cargo run -p build-wasm-example -- --api webgl2 sprite && \
open "http://localhost:4000" && \
python3 test_403.py examples/wasm
```
`test_403.py`:
```python
from http.server import HTTPServer, SimpleHTTPRequestHandler
import os
import sys


class CustomHandler(SimpleHTTPRequestHandler):
    def do_GET(self):
        if self.path.endswith(".meta"):
            self.send_response(403)
            self.send_header("Content-type", "text/plain")
            self.end_headers()
            self.wfile.write(b"403 Forbidden: Testing.\n")
        else:
            super().do_GET()


if __name__ == "__main__":
    if len(sys.argv) != 2:
        print(f"Usage: {sys.argv[0]} <directory>")
        sys.exit(1)

    os.chdir(sys.argv[1])

    server_address = ("", 4000)
    httpd = HTTPServer(server_address, CustomHandler)
    httpd.serve_forever()
```

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Ben Frankel <ben.frankel7@gmail.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>
2025-05-30 23:53:51 +02:00
..
bevy_a11y Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_animation Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_app Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_asset Fix missing meta files breaking Bevy on itch (#19268) 2025-05-30 23:53:51 +02:00
bevy_audio Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_color Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_core_pipeline Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_derive Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_dev_tools Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_diagnostic Diagnostic reset sum ema (#19337) 2025-05-30 22:59:10 +02:00
bevy_dylib Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_ecs Fix EntityCloner replacing required components. (#19326) 2025-05-30 23:53:51 +02:00
bevy_encase_derive Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_gilrs Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_gizmos Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_gltf Make sure that serde_json::Map::into_values exists (#19229) 2025-05-30 22:59:10 +02:00
bevy_image Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_input Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_input_focus Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_internal Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_log Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_macro_utils Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_math Fix rotate_by implementation for Aabb2d (#19015) 2025-05-30 22:59:09 +02:00
bevy_mesh Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_mikktspace Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_pbr Fixed memory leak in bindless material (#19041) 2025-05-30 23:53:51 +02:00
bevy_picking Removed conversion from pointer physical coordinates to viewport local coordinates in bevy_picking make_ray function (#18870) 2025-05-30 22:59:09 +02:00
bevy_platform Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_ptr Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_reflect Make sure that serde_json::Map::into_values exists (#19229) 2025-05-30 22:59:10 +02:00
bevy_remote Make sure that serde_json::Map::into_values exists (#19229) 2025-05-30 22:59:10 +02:00
bevy_render doc(render): fix incorrectly transposed view matrix docs (#19317) 2025-05-30 23:53:51 +02:00
bevy_scene Fix #19219 by moving observer triggers out of resource_scope (#19221) 2025-05-30 23:53:51 +02:00
bevy_sprite Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_state Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_tasks Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_text Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_time Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_transform Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_ui Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_utils Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_window Release 0.16.0 2025-04-21 23:14:00 +02:00
bevy_winit Add WakeUp event to App (#19212) 2025-05-30 22:59:10 +02:00