Skip to content

Conversation

marocchino
Copy link
Contributor

@marocchino marocchino commented Nov 21, 2024

About the changes

Ruby's file writing defaults to utf-8, but net http's response seems to be based on the header and ASCII is used by default when no specification is made.
I didn't write any test files, but I verified them as follows:

# run with main branch
bin/spring stop
bin/rails c
> Unleash::Client.new
[Unleash] ERROR: Unable to save backup file. Exception thrown Encoding::UndefinedConversionError:'"\xE3" from ASCII-8BIT to UTF-8'
...
# run with this branch
bin/spring stop
bin/rails c
> Unleash::Client.new
(no error)

Closes #214

Important files

Discussion points

def self.http_connection(uri)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == 'https'
http.response_body_encoding = 'UTF-8'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11944771961

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 95.385%

Totals Coverage Status
Change from base Build 11814257586: 0.01%
Covered Lines: 434
Relevant Lines: 455

💛 - Coveralls

@sighphyre sighphyre self-assigned this Nov 21, 2024
@sighphyre
Copy link
Member

Thanks for the fix, seems reasonable

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sighphyre sighphyre merged commit 744b728 into Unleash:main Nov 21, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Encoding issue with old backup file

3 participants