Skip to content

Cookies handling is incorrect #70

@raszi

Description

@raszi

Environment

io.sentry/sentry-clj "7.20.226"
org.clojure/clojure "1.12.0"

Steps to Reproduce

Send a request map with cookies set.

Expected Result

The cookies are correctly parsed and sent to Sentry.

Actual Result

java.lang.ClassCastException: class java.util.HashMap cannot be cast to class java.lang.String (java.util.HashMap and java.lang.String are in module java.base of loader 'bootstrap')
	at sentry_clj.core$map__GT_request.invokeStatic(core.clj:85)
	at sentry_clj.core$map__GT_request.invoke(core.clj:71)
	at sentry_clj.core$map__GT_event.invokeStatic(core.clj:139)
	at sentry_clj.core$map__GT_event.invoke(core.clj:113)
	at sentry_clj.core$send_event.invokeStatic(core.clj:365)
	at sentry_clj.core$send_event.invoke(core.clj:354)

Explanation

The map->request function handles the value of the :cookies key as a hashmap, and tries to pass that to the io.sentry.protocol.Request/setCookies method as a hasmap, but that method receives a String.

https://getsentry.github.io/sentry-java/io/sentry/protocol/Request.html#setCookies(java.lang.String)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions