Skip to content
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

[BUG]: Undefined slash-parameters likely expanded incorrectly #395

Closed
1 task done
amezin opened this issue Jan 22, 2023 · 1 comment · Fixed by #455
Closed
1 task done

[BUG]: Undefined slash-parameters likely expanded incorrectly #395

amezin opened this issue Jan 22, 2023 · 1 comment · Fixed by #455
Labels
hacktoberfest Issues for participation in Hacktoberfest released Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@amezin
Copy link

amezin commented Jan 22, 2023

What happened?

> const { endpoint } = require("@octokit/endpoint");
> endpoint("http://api.github.com/repos/octocat/Hello-World/branches{/branch}", {})
{
  method: 'GET',
  url: 'http://api.github.com/repos/octocat/Hello-World/branches/',
  headers: {
    accept: 'application/vnd.github.v3+json',
    'user-agent': 'octokit-endpoint.js/7.0.4 Node.js/19.4.0 (linux; x64)'
  }
}

Note the slash at the end of url. GitHub returns 404 for .../branches/, but lists branches for .../branches.

Expanding the same URL with url-template and empty context returns .../branches. This makes me belive that endpoint.js performs template expansion incorrectly.

Versions

Octokit.js v7.0.4, Node v19.4.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@amezin amezin added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jan 22, 2023
@nickfloyd nickfloyd moved this from 🆕 Triage to 🔖 Ready in 🧰 Octokit Active Jan 23, 2023
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone Priority: Normal and removed Status: Triage This is being looked at and prioritized labels Feb 3, 2023
@nickfloyd nickfloyd moved this from 🔖 Ready to 🔥 Backlog in 🧰 Octokit Active Aug 14, 2023
@nickfloyd nickfloyd added the hacktoberfest Issues for participation in Hacktoberfest label Sep 20, 2023
@github-project-automation github-project-automation bot moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Active Oct 27, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 9.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

amezin added a commit to ddterm/ghcr-cleanup that referenced this issue Nov 25, 2023
amezin added a commit to ddterm/ghcr-cleanup that referenced this issue Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for participation in Hacktoberfest released Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants