Skip to content
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

Duplicate frozen string value when force encoding in make_json #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soedar
Copy link

@soedar soedar commented Jul 22, 2020

When using the gelf formatter, like so:

<match **>
  @type stdout
  format gelf
</match>

We run encounter the following error:

#0 Error trying to serialize [original string]: can't modify frozen String

It appears that in the make_json function, the string values in gelfentry could potentially be a frozen string. This PR duplicates the string before calling force_encoding.

@soedar soedar changed the title Duplicate frozen string value when force encoding Duplicate frozen string value when force encoding in make_json Jul 22, 2020
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.

1 participant