-
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
Crash on response 'Link" header parsing #1325
Comments
@swinton any insight into recent changes that may have broken this? |
If it helps anyone, we are working around this by introducing a Faraday middleware step to strip the class LinkHeaderRemover < Faraday::Response::Middleware
OAUTH_LOGIN_URL_PATH = "/login/oauth/access_token"
def on_complete(env)
request_path = URI(env.url).path
return if request_path != OAUTH_LOGIN_URL_PATH
response_headers = env.response_headers
return if response_headers.nil?
response_headers.delete("link")
end
end Setup in your pipeline like so: middleware = Octokit::Default.middleware.dup
middleware.insert_before(middleware.handlers.length - 1, LinkHeaderRemover)
Octokit.middleware = middleware |
I think this has been fixed on the GitHub side, is anyone running into these issues still? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since yesterday, the "Link" header returned when doing Web application flow, i.e.
is formatted in a way that results in a crash when calling exchange_code_for_token:
Besides questioning why GitHub API changed, apparently
sawyer
has a bug!FYI, to address the bug, in
sawyer
, I opened lostisland/sawyer#68 issue and related lostisland/sawyer#69 PR.The text was updated successfully, but these errors were encountered: