-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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]: Octokit doesn't seem to support conditional requests using ETags #2563
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
I can assure it does work, but if I recall correctly, you need to include the $ curl -I https://api.github.com/user -H 'If-None-Match: "644b5b0155e6404a9cc4bd9d8b1ae730"'
> HTTP/2 304
> Cache-Control: private, max-age=60
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Vary: Accept, Authorization, Cookie
> x-ratelimit-limit: 5000
> x-ratelimit-remaining: 4996
> x-ratelimit-reset: 1372700873 |
Hi, thank you for your response! I am able to get this code to work using a curl request while including the double quotes, doing this returns an expected 304. However, the issue is with Octokit. I am unable to get a 304 response when providing the If-None-Match header with the etag value. Could you show me an example of how to make this request using Octokit.js? |
There you go: https://runkit.com/gr2m/octokit-octokit-js-2563/1.0.0 |
I just ran into this again and confirmed that it's working as expected. |
What happened?
I have been trying to increate the efficiency our app has with its GitHub rate limit by using ETags through octokit. I have a GitHub app and am using the org installation authentication, when a request is sent with the header If-none-match: "etag" we get a 200 back every time. However, if I perform the same request using curl or postman, I will get a 304 Not Modified which is what I expect.
Am I using Etags wrong in the octokit request or does octokit not support the use of Etags. I am using "@octokit/app": "^13.1.8".
An example of the request follows.
Versions
"@octokit/app": "^13.1.8",
Node 18.18.2
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: