Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Cast HTTP response body for JSON to string (regression from #4)#5

Merged
Gargron merged 1 commit intomastodon:masterfrom
ykzts:to_s
Aug 4, 2017
Merged

Cast HTTP response body for JSON to string (regression from #4)#5
Gargron merged 1 commit intomastodon:masterfrom
ykzts:to_s

Conversation

@ykzts
Copy link
Copy Markdown
Member

@ykzts ykzts commented Aug 4, 2017

Oj uses readpartial instead of to_s if the value given for the arguments has a readpartial method (ext/oj/reader.c#L73-L75). Also, HTTP.rb splits the response if Transfer-Encoding: chunked is returned in the HTTP headers (lib/http/response/body.rb#L26-L30).

Will use to_s like JSON.parse which was used previously (ext/json/ext/parser/parser.c#L1824).

error case

Sidekiq screenshot

Oj uses `readpartial` instead of `to_s` if the value given for the arguments has a `readpartial` method.
Also, HTTP.rb splits the response if `Transfer-Encoding: chunked` is returned in the HTTP headers.

Will use `to_s` like `JSON.parse` which was used previously.
@Gargron Gargron merged commit 29dce59 into mastodon:master Aug 4, 2017
@Gargron
Copy link
Copy Markdown
Member

Gargron commented Aug 4, 2017

When do the errors occur? How severe is this? Do we need to rush a patch release for Mastodon to get this update in?

@ykzts ykzts deleted the to_s branch August 4, 2017 12:13
@ykzts
Copy link
Copy Markdown
Member Author

ykzts commented Aug 4, 2017

  • https://social.umeahackerspace.se/.well-known/webfinger?resource=acct:[email protected]

I noticed the problem with this URL. This only happens with very few servers.

Goldfinger should update, but I do not think it is necessary to rush Mastodon 's patch release.

Gargron added a commit to mastodon/mastodon that referenced this pull request Aug 5, 2017
Gargron added a commit to mastodon/mastodon that referenced this pull request Aug 5, 2017
pfigel added a commit to pfigel/mastodon that referenced this pull request Aug 7, 2017
* tag 'v1.5.1': (25 commits)
  Bump to 1.5.1
  i18n: update Persian translation (mastodon#4540)
  Fix mastodon#4531 (mastodon#4533)
  fr.yml update (mastodon#4531)
  Translate 'Signed in as' into Japanese (mastodon#4530)
  l10n OC - Added  mastodon#4523 "signed in as" (mastodon#4529)
  fix columns_area.js (mastodon#4528)
  Update goldfinger to 2.0.1, see mastodon/goldfinger#5 (mastodon#4527)
  Add "signed in as" header to some pages (mastodon#4523)
  l10n update Occitan (mastodon#4522)
  Scroll columns area to right when children property is changed (mastodon#4517)
  Fix some mistakes in Polish translation (mastodon#4495)
  Ignore some locale keys that can but do not need to be translated (mastodon#4515)
  Dutch strings: typo (mastodon#4489)
  Use GNU libiconv in Nokogiri (mastodon#4494)
  i18n: Update Polish translation (mastodon#4479)
  Enable cache for babel-loader (mastodon#4505)
  Redirect to PasswordController#new when reset_password_token is invalid (mastodon#4506)
  make number of comparison in emojify() fewer (mastodon#4500)
  Don't normalize invalid domain names (mastodon#4499)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants