developer-relations icon indicating copy to clipboard operation
developer-relations copied to clipboard

[BUG]

Open justinbuhrmann1997 opened this issue 4 years ago • 2 comments

Bug Description
When trying to retrieve a match by id through match v5 an internal server error is returned. (Using endpoint "https://europe.api.riotgames.com/lol/match/v5/matches/{MatchID}")

Problem Description
The problem seems to occur when adding application/json to the Accept header of the request. Entire accept header looks like this: Accept: */*; q=0.5, text/plain; q=0.8, text/html;level=3;q=0.9, application/json

Expected Result
Since adding this header works in all other endpoints, it was expected to return a list of match id's, as it is supposed to.

Actual Result
The result that was received (as json) is: { "status": { "message": "Internal server error", "status_code": 500 } }

Developer Impact
This happens every time the header is added to the API call. It does not cause any major inconveniences for me, other than having to remove a bit of code.

Preconditions
What conditions must be met in order for this bug to occur?

  • Add the described header content to the Accept header in a normal API request

Repro Steps
Step by step, what do you need to do to cause the bug? Note that GitHub will automagically number each step if you prefix the line with "1. "

  1. Create a basic HTTP request that calls to "https://europe.api.riotgames.com/lol/match/v5/matches/{MatchID}".
  2. Add application/json to the Accept header of the request.
  3. Execute the request.

Issue Comments
If you're also experiencing this issue please add any additional context that is useful, the developer impact to yourself, and the player impact to your users. As an example, if spectator-v4 isn't working it might affect a scouting site, but it could also affect a mobile app or site to share replays. Give the context on how this issue affects your project.

justinbuhrmann1997 avatar Sep 14 '21 12:09 justinbuhrmann1997

This is the expected response as your header is invalid.

As according to spec the q-factor weighting comes after the MIME type with a semicolon in between.

application/json;q=0.9

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept

bangingheads avatar Sep 14 '21 12:09 bangingheads

This is the expected response as your header is invalid.

As according to spec the q-factor weighting comes after the MIME type with a semicolon in between.

application/json;q=0.9

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept

You are correct, However I misread the header string. The accept header looks like this Accept: */*; q=0.5, text/plain; q=0.8, text/html;level=3;q=0.9, application/json. the noted q-factor in the issue applies to the text/html part of the header. I have edited the original issue to prevent further confusion, thanks for noting!

justinbuhrmann1997 avatar Sep 14 '21 13:09 justinbuhrmann1997