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

Invalid JSON body is sent #311

Open
Tiller opened this issue Mar 6, 2025 · 2 comments
Open

Invalid JSON body is sent #311

Tiller opened this issue Mar 6, 2025 · 2 comments

Comments

@Tiller
Copy link

Tiller commented Mar 6, 2025

Hello

When I try to use the browser extension, it sends the body as the string "[object Object]" instead of the actual json body. I've tried both with firefox and chromium, with extension v0.37.

Image

curl --request POST \
  --url http://localhost:3000/api/v1/build/addToQuote/flow \
  --header 'content-type: application/json' \
  --data '{
  "inputs": {
    "input_value": "Your custom input here",
    "session": "session_id"
  }
}
'

Image

Image

@Zambonilli
Copy link

Yeah, I've has similar results. One of my JSON fields had an escaped quote via \" in its value. Awkwardly, switching to using single quotes and not escaping the double quotes instead of double quotes around the field value worked. I'd think the value in the body should be JSON parsed and then sent but it seems like the browser extension is just reading the body values in as javascript strings.

However, similar to you, I'm starting to hit issues with invalid JSON being sent to the URL when there is no escaping going on in the payloads. Also, wish there was a way to get raw logs of requests and responses so we didn't have to drop down to network tools like you did with wireshark.

@Zambonilli
Copy link

I found a workaround by setting the content type dropdown to text/plain and then overriding the content-type with application/json; charset=UTF-8 in the headers. The behavior of the extension looks to skip any sort of JSON parsing and just passes through the data and then the overridden header sets the request's content type to JSON.

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

2 participants