-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@mapsam, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @tmcw and @yhahn to be potential reviewers. |
Btw, this assumes an access token will always be first, which is probably not a good thing. |
Updated the PR to search specifically for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you had a look at the test failures? Looks like this is not quite doing what you expect.
const auto query = url.substr(queryIdx); | ||
// get access token index | ||
const auto accessTokenIdx = (query.find("access_token") == 0) ? 0 : query.find("access_token") - 1; // if it's not the first param, grab the & as well | ||
const auto accessTokenEndIdx = (accessTokenIdx == 0) ? query.find("&", accessTokenIdx) + 1 : query.find("&", accessTokenIdx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line assumes there is a second parameter by checking for query.find("&", accessTokenIdx)
. If the response from this is 0
, we need to grab the end of the query for accessTokenEndIdx
.
@jfirebaugh yep, tests were indeed failing. I've updated the URL work to use a |
@jfirebaugh any chance I could get a review here? Much appreciated! |
Thank you @jfirebaugh! |
Preserves any custom parameters for the Tile URL, strip out the first parameter (access token) and append the rest back into the tile URL, if they exist.
cc @jakepruitt @jfirebaugh @incanus