Skip to content

🤖 avm2: Send Accept: */* from URLRequest (#9395)#23771

Open
MavenRain wants to merge 2 commits into
ruffle-rs:masterfrom
MavenRain:fix/loader-accept-header
Open

🤖 avm2: Send Accept: */* from URLRequest (#9395)#23771
MavenRain wants to merge 2 commits into
ruffle-rs:masterfrom
MavenRain:fix/loader-accept-header

Conversation

@MavenRain
Copy link
Copy Markdown

Description

Addresses the Accept-header piece of #9395.

Flash Player sent Accept: / as its default Accept header on URLLoader /
Loader / URLStream fetches. Ruffle currently sends nothing on the desktop
build (reqwest doesn't auto-add Accept), so servers see no Accept header at
all; on the web build the browser's default flows through.

The fix mirrors the X-Flash-Version (#23754) and User-Agent (#23769) PRs
already open against this issue: request_from_url_request in
flash.display.Loader inserts an Accept entry into string_headers before the
user-headers loop, so the per-request header is transmitted while still
letting URLRequest.requestHeaders win for users who supply their own.

Accept value

Accept: /

Real Flash Player varied the Accept value slightly for specialized loads
(image loads sometimes had MIME priorities), but the URLLoader / Loader
umbrella case was always /. Reviewers can ask for per-context variants in
follow-up.

Test updates

tests/tests/swfs/avm2/loader_load/output.txt and
tests/tests/swfs/avm2/loader_method/output.txt updated to include the new
Accept: / line. These were the only log_fetch=true fixtures whose output.txt
exercises a URLRequest path.

Remaining #9395 scope

After this lands, the only remaining header from the original umbrella is
Accept-Encoding. That one is non-trivial because Ruffle's reqwest client is
configured without the gzip / deflate decompression features, so we'd either
need to enable those features (changes desktop runtime behavior) or send
Accept-Encoding: identity (diverges from Flash). Holding that as a separate
follow-up.

Verification

  - cargo fmt --all --check
  - cargo clippy -p ruffle_core --tests --lib
  - cargo test --package tests (url_*, netconnection_*, loader_*: all green)

Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
@danielhjacobs danielhjacobs added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player llm The PR contains mostly LLM-generated code labels May 21, 2026
…eader

Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) llm The PR contains mostly LLM-generated code T-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants