Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

SearchDestinyPlayer membershipId wrong? #271

Open TheSilentBoot opened 6 years ago

TheSilentBoot commented 6 years ago

When I do /Destiny2/SearchDestinyPlayer/4/Reaper#19316

it returns membershipId 4611686018469242818 and that user is some psn user with the name xXSlyTheGamerXx

am I just doing something wrong?

ArkahnX commented 6 years ago

Please reference the solution in #258

TheSilentBoot commented 6 years ago

Please reference the solution in #258

its already being encoded. :/

vthornheart-bng commented 6 years ago

Hmm, I just tried it and got user 4611686018467946411, which does appear to be a user named Reaper from Battle.net.

TheSilentBoot commented 6 years ago

Hmm, I just tried it and got user 4611686018467946411, which does appear to be a user named Reaper from Battle.net.

very odd yes that is the correct one but im getting some psn user

vthornheart-bng commented 6 years ago

Oh, I see. When I left the # un-encoded, it did indeed return 4611686018469242818. I believe the source of the problem is that you are unfortunately leaving the URL un-encoded (thus the search for "Reaper"), and then a second error - one on our part - is returning this incorrect user when only "Reaper" gets searched as a result of the un-encoded # symbol truncating off the remainder of the data being requested in the search.

I'll have to look further into why that search returns a user at all, but indeed the wrong user at least comes from not encoding that # into %23. Double check whatever you're doing to encode the hash symbol before it's sent and let me know!

TheSilentBoot commented 6 years ago

https://bungie.net/Platform/Destiny2/SearchDestinyPlayer/4/Reaper%2319316 { Response: [ { membershipType: 4, membershipId: '4611686018469242818', displayName: 'Reaper' } ], ErrorCode: 1, ThrottleSeconds: 0, ErrorStatus: 'Success', Message: 'Ok', MessageData: {} }

vthornheart-bng commented 6 years ago

Oh, ha! I see it now... that is a really pesky bug, sneaky!

So the problem is that you're hitting bungie.net and not www.bungie.net. Unfortunately, we issue a 301 in this situation that redirects you, but the redirection un-encodes the URL once more, and you're left with the reissued request automatically turning into # instead of %23 again. That is a super sneaky error, ha!

I think one thing I'd like to do if possible would be for us to start responding to requests that hit just plain ol' https://bungie.net... but in the meantime, switch up the base of the url to www.bungie.net and try again!

TheSilentBoot commented 6 years ago

Yep that worked haha, Thanks!

vthornheart-bng commented 6 years ago

No prob! Phew, that was a tricky one given that our site was still giving you a response - and an incorrect one! That's definitely something we'll have to look into for sure.

RoryO commented 5 years ago

Oh, ha! I see it now... that is a really pesky bug, sneaky!

So the problem is that you're hitting bungie.net and not www.bungie.net. Unfortunately, we issue a 301 in this situation that redirects you, but the redirection un-encodes the URL once more, and you're left with the reissued request automatically turning into # instead of %23 again. That is a super sneaky error, ha!

I think one thing I'd like to do if possible would be for us to start responding to requests that hit just plain ol' https://bungie.net... but in the meantime, switch up the base of the url to www.bungie.net and try again!

Yikes. Sorry to drag up such an old thread. This hit me today. Consider it a ping!