🤖 avm2: Send Accept: */* from URLRequest (#9395)#23771
Open
MavenRain wants to merge 2 commits into
Open
Conversation
Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
…eader Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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