YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

In-Game: http_request() should support "accept-encoding" set to "gzip" and decompress the response automatically #8002

Open DiasFranciscoA opened 1 week ago

DiasFranciscoA commented 1 week ago

Description

If you create an http request with header options setting “accept-encoding” to “gzip” the result returned in the async event will NOT decompress the response body buffer by default. Leading to an a usable response body, some rest APIs rely on that and there is absolutely no work around for this. A the fix is actually pretty trivial (enabling auto decompression by default, which should be the default behavior anyway) and risk free. Should be considered for Nov24.

Expected Change

Be able to receive gzip encoded HTTP request responses.

Steps To Reproduce

  1. Start GameMaker
  2. See the issue

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.1100 (Betas)

Which platform(s) are you seeing the problem on?

Windows

Sample Package Attached?

Sample Project Added?

YYDan commented 1 week ago

@DiasFranciscoA Could you add a sample which fails just now and you're expecting to work after the change is made, please?

DiasFranciscoA commented 1 week ago

@jzavala-YYG will probably be the one to have a good example|demo to test this on.... since the original "BUG" came from him!

jzavala-YYG commented 1 week ago

Project attached: GM project and HTTP file that run using Visual Studio Code + REST Client (if you want do testing outside from GameMaker) entity_gzip_test.zip

Basically _playfab_client_auth_login_with_customid in the object _obj_playfablogin it's trying to login and success it in both cases if the header Accept-Encoding equals "identity" or "gzip"

The resutls are like this:

with identity: "{\"code\":200,\"status\":\"OK\",\"data\":{\"SessionTicket\":\"............................a very big json.......... with data about log in

with gzip: "\u001f�\b"

You can change the header Accept-Encoding in the script _playfabapi line 25

The idea it's see the same result even using other encoding headers (gzip, compress, deflate, br, zstd)