Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey all! I think I found and fixed a small bug; using this PR to start a discussion. When I tried updating Redwood's all contributors table, I got a
Only absolute URLs are supported
error, so I dug in a bit. This is the command I ran:And here's the
.all-contributorsrc
file: https://github.com/redwoodjs/redwood/blob/main/tasks/all-contributors/.all-contributorsrc.I stepped through the code and narrowed it down; the error's happening in the
getNextLink
function. Here's the value forlink
:'<https://api.github.com/repositories/191051391/contributors?per_page=100&page=1>; rel="prev", <https://api.github.com/repositories/191051391/contributors?per_page=100&page=3>; rel="next", <https://api.github.com/repositories/191051391/contributors?per_page=100&page=3>; rel="last", <https://api.github.com/repositories/191051391/contributors?per_page=100&page=1>; rel="first"'
The function splits
link
on commas and looks forrel=next
. In this case, it's the second link. So splitting it results in:That means the next call (
return nextLink.split(';')[0].slice(1, -1);
) results in:When another function tries to fetch this link, it throws.
It seems like all we need to do is trim the string before slicing, but let me know what you think!