Skip to content

Commit 051b3b6

Browse files
authored
Also check for gzip when considering request encodings (#908)
As discussed on Discord. https://discord.com/channels/1049223665243389953/1049225857350254632/1400079015754334259 Pretty much, we haven't been properly compressing some requests for a while, because some requests ask for `gzip` when they are really asking for `deflate`. I'm 99% sure LBP just sends bullshit for the `Accept-Encoding` header half the time. Lets see how this goes. This may or may not require a revert so I'll try and do some testing first. I'm unsure if this would be LLE/HLE in RPCS3 so it would be good to test on both RPCS3 and PS3. PSP and Vita would also be good to test but I don't have access to those platforms. Potential solution for #700.
2 parents a06b9df + d35947c commit 051b3b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Refresh.GameServer/Middlewares/DeflateMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public void HandleRequest(ListenerContext context, Lazy<IDatabaseContext> databa
4141
return;
4242

4343
string? encodings = context.RequestHeaders.Get("Accept-Encoding");
44-
// If the accepted encodings aren't specified, or they don't contain deflate, or we don't need to use deflate on the data, do nothing.
45-
if (encodings == null || !encodings.Contains("deflate") || context.ResponseStream.Length <= DeflateCutoff)
44+
// If the accepted encodings aren't specified, or they don't contain deflate/gzip, or we don't need to use deflate on the data, do nothing.
45+
if (encodings == null || (!encodings.Contains("deflate") && !encodings.Contains("gzip")) || context.ResponseStream.Length <= DeflateCutoff)
4646
return;
4747

4848
// Update the headers marking that we are sending encoded data

0 commit comments

Comments
 (0)