Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fetchNoCors and http_request data handling #664

Merged
merged 4 commits into from
Aug 3, 2024

Conversation

FrogTheFrog
Copy link
Contributor

@FrogTheFrog FrogTheFrog commented Jul 30, 2024

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

Description

This PR solves 4 problems:

  1. fetchNoCors does not prefix explicitly specified headers which can later be overwritten or deleted by http_request handler. Arguably, if the user has specified headers explicitly then they must be sent out in the end.
  2. http_handler would automatically decompress received data, but not intended to do so. Decompressing is now delegate to JS engine.
  3. fetchNoCors would cache the the request incorrectly under a generic http://127.0.0.1:1337/fetch url if the server response asks it to. Caching could be disabled completely for fetchNoCors, however another approach was taken - url is added as a query parameter so that the cache is associated correctly with the provided url.
  4. http_handler no longer has special headers for auth and url, and are now parsed from query only. Replaced the get methods with access operators so that the exception is thrown early on an ill-formed url to avoid confusing exceptions down the line.

@FrogTheFrog FrogTheFrog changed the title fix: Make http_request backwards compatible fix(fetchNoCors): prefix all the headers to be used Jul 30, 2024
@FrogTheFrog FrogTheFrog changed the title fix(fetchNoCors): prefix all the headers to be used fix(fetchNoCors): prefix all the headers for passthrough Jul 30, 2024
@FrogTheFrog FrogTheFrog marked this pull request as draft July 30, 2024 16:09
@FrogTheFrog FrogTheFrog changed the title fix(fetchNoCors): prefix all the headers for passthrough fix: fetchNoCors and http_request data handling Aug 3, 2024
@FrogTheFrog FrogTheFrog marked this pull request as ready for review August 3, 2024 13:28
@TrainDoctor TrainDoctor requested a review from AAGaming00 August 3, 2024 13:38
@TrainDoctor TrainDoctor added the enhancement New feature or request label Aug 3, 2024
@AAGaming00 AAGaming00 merged commit 3e50ce6 into SteamDeckHomebrew:main Aug 3, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants