Skip to content

RegExp Fix for _requestAllPages #582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2019
Merged

Conversation

tamer1an
Copy link
Contributor

@tamer1an tamer1an commented Sep 1, 2019

Hi @j-rewerts

Remember we remove ampersand in this PR
86775a6#diff-5a59658a5ca4e1b25fde329807afc34fR264-R265

nextUrl.match(/(page=[0-9]*)/g)

Unfortunately regexp then mach other get parameter like &per_page

nextUrl =
"https://github.ldn.swissbank.com/api/v3/organizations/68/repos?direction=desc&type=all&sort=updated&per_page=100&page=2"
parseInt(nextUrl.match(/(page=[0-9]*)/g).shift().split('=').pop()); // 100

parseInt(nextUr.match(/([&\?]page=[0-9]*)/g).shift().split('=').pop()); // 2

@j-rewerts I suggest to add use this improved regexp that will match both cases: ?page=, &page=

tamer1an and others added 2 commits September 1, 2019 20:37
'&' RegExp Fix for _requestAllPages
regexp compatible with both: ?page=, &page=
Copy link
Member

@j-rewerts j-rewerts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Approved.

@j-rewerts j-rewerts merged commit 29c3c7a into github-tools:master Sep 6, 2019
@tamer1an tamer1an deleted the patch-1 branch September 12, 2019 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants