It is currently April 18th, 2024, 6:50 pm

[Feature Suggestion] WebParser Measure | Content-Encoding: gzip

Report bugs with the Rainmeter application and suggest features.
User avatar
nek
Posts: 105
Joined: November 3rd, 2019, 12:00 am

[Feature Suggestion] WebParser Measure | Content-Encoding: gzip

Post by nek »

## Feature Suggestion
There are no option settings to recognize gzipped web contents in the WebParser Measure.
It is possible to set Header=Accept-Encoding: gzip, deflate, br in the WebParser Measure as a HTTP request, though.

## Reasons
- WebParser Measure can behave more like web browser.
- There is Web service API that requires "Accept-Encoding: gzip" in the HTTP request header.

### General HTTP request/response behavior
Web Browser ---Accept-Encoding: gzip, deflate, br--> Web Server
Web Browser <--Content-Encoding: gzip--- Web Server

Code: Select all

#### Web Browser | HTTP request headers
GET / HTTP/1.1
Host: www.example.com
--------
Accept: text/html,...
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
...

#### Web Server | HTTP response headers
HTTP/1.1 200 OK
--------
Date: Thu, 06 Aug 2020 10:00:00 GMT
Server: lighthttpd/1.4.53
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Connection: keep-alive
...

I don't have any knowledge about c++ code, but I have found something that might be related.

WinInet InternetSetOptionA function | https://docs.microsoft.com/windows/win32/api/wininet/nf-wininet-internetsetoptiona
WinInet INTERNET_OPTION_HTTP_DECODING | https://docs.microsoft.com/windows/win32/wininet/option-flags#internet_option_http_decoding

Rainmeter WebParser Measure c++ code | https://github.com/rainmeter/rainmeter/blob/master/Library/MeasureWebParser.cpp
Accept-Encoding | https://developer.mozilla.org/docs/Web/HTTP/Headers/Accept-Encoding
Content-Encoding | https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Encoding