Skip to content

Conversation

@daniloisr
Copy link
Contributor

Hi all, when using remote config I was facing the following error:

bad URI(is not URI?):

On lines lib/rubocop/remote_config.rb:48-49:

when Net::HTTPRedirection
  request(URI.parse(response['location']), limit - 1, &block)

This happens for 304 HTTPNotModified responses, which don't have the 'location' key.
(and to help reviewers, 304 responses occurs due this header)

So my solution is to just handle this response and reuses the existing cached file.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 10, 2017

The fix looks good, but it should be listed in the changelog.

@daniloisr daniloisr force-pushed the fix-remote-not-modified-reponses branch from bcd2ff7 to eb75fa0 Compare June 10, 2017 09:53
@daniloisr
Copy link
Contributor Author

@bbatsov done

@mikegee
Copy link
Contributor

mikegee commented Jun 10, 2017

@daniloisr add yourself to the bottom of the changelog too to get the build to pass.

When remote file response is NotModified, we can reuse the existing
cached file.
@daniloisr daniloisr force-pushed the fix-remote-not-modified-reponses branch from eb75fa0 to de20b1e Compare June 10, 2017 14:28
@bbatsov bbatsov merged commit 4a81790 into rubocop:master Jun 10, 2017
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 10, 2017

👍

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.

3 participants