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

Ensure UTF-8 encoding #30

Open
Frozenlock opened this issue Jan 15, 2020 · 0 comments
Open

Ensure UTF-8 encoding #30

Frozenlock opened this issue Jan 15, 2020 · 0 comments

Comments

@Frozenlock
Copy link

On a Windows machine, utf-8 strings passed to raven/capture will not be properly encoded when sent to Sentry.

As far as I can tell, this is because something in the http stack is using the default file encoding.
Temporary workaround:
Launch the JVM with -Dfile.encoding=utf-8

Potential solution:
Explicitly encode the body into utf-8 bytes.

(defn send-packet [{:keys [ts uri project-id key secret] :as packet-info}]
  (let [url (make-sentry-url uri project-id)
        header (make-sentry-header ts key secret)
        body (dissoc packet-info :ts :uri :project-id :key :secret)]
    (http/post url
               {:throw-exceptions false
                :headers {"X-Sentry-Auth" header
                          "User-Agent" sentry-client}
                :body (util/utf8-bytes (json/generate-string body))}))) ; <------
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

No branches or pull requests

1 participant