GithubHelp home page GithubHelp logo

Comments (2)

martinsileno avatar martinsileno commented on June 6, 2024

Hi, thanks for reporting.

I added the header to make the server respond with gzipped content, as explained here.

However, it appears that this is a forbidden header name for browsers, but it is fine when sending requests from other sources (like node).

Just to confirm, do you get a gzipped response (does the server reply with Content-Encoding: gzip) after commenting out the Accept-Encoding header?

I will patch it by defaulting useGzip to false, so that it can be set to true when initializing PubgAPI when using node and it stays false if sending requests through a browser.

from pubg-typescript-api.

Otrozone avatar Otrozone commented on June 6, 2024

Hello,
I used the wrapper in fully client side application, so it was used quite unusual way. Expected usage is here server to server, where the Accept-Encoding could be smooth. So my error report was probably misleading. Sorry for that.

The new version #7 (1.3.1) works perfectly w/o error even on client side. It looks like the response is using gzip. Here are the headers for new version:

General
Request URL: https://api.playbattlegrounds.com/shards/pc-eu/matches/41dd024d-9bc5-4b76-b0d8-6c0330d675d3
Request Method: GET
Status Code: 200  (from disk cache)
Remote Address: 54.230.129.45:443
Referrer Policy: no-referrer-when-downgrade

Response headers
access-control-allow-origin: *
access-control-expose-headers: Content-Length
age: 42254
cache-control: max-age=604800
content-encoding: gzip
content-type: application/json
date: Tue, 22 May 2018 19:01:18 GMT
status: 200
vary: Accept-Encoding
via: 1.1 e50082f108f86da8af6ed222cfcad2b5.cloudfront.net (CloudFront)
x-amz-cf-id: CYsmtNcLlE_sHx48lV8jmWPYZwN1n6qWdfeafX_ZcYm4BETcs6nMyA==
x-cache: Hit from cloudfront
x-request-id: 604b0c16-01e3-4638-9357-770e93891270

Request headers
Provisional headers are shown
Accept: application/json
Authorization: Bearer eyJ...KmWKWaM
Origin: http://localhost:4200
Referer: http://localhost:4200/matches
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

Thank you.

from pubg-typescript-api.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.