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

Response message get processed by JSON.stringify() multiple times. #1396

Closed
MrLis opened this issue Apr 8, 2024 · 1 comment
Closed

Response message get processed by JSON.stringify() multiple times. #1396

MrLis opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MrLis
Copy link

MrLis commented Apr 8, 2024

What happens?

Response message get processed by JSON.stringify() multiple times.

See example
Screenshot 2024-04-08 233406 (2)

Method "ping" actually returns string "Pong\n" not the "\\"Pong\\\\n\\"".

I want to note that i'm not using data-proxy-url.
It seems that using a proxy may change the visible response value.

What did you expect to happen?

Raw data that server returns:
Screenshot 2024-04-08 233406 (3)

How can we reproduce the issue?

The same result can be achieved by using this command:
console.log(JSON.stringify(JSON.stringify("Pong\n")));

Swagger/OpenAPI Example

No response

@MrLis MrLis added the bug Something isn't working label Apr 8, 2024
@hwkr hwkr self-assigned this Apr 9, 2024
@hwkr hwkr closed this as completed May 15, 2024
@hanspagel
Copy link
Member

Not merged and released yet, though. But soon. 🤞

marclave added a commit that referenced this issue May 21, 2024
* feat: use new proxy 🥳

* chore: revert to use env var for proxy

* chore: remove trailing slash

* chore: remove old api client proxy example

* chore: disable old proxy tests

* docs: show how to use a different port for the proxy

* chore: use same port as before for the new proxy server

* fix: fetch spec test uses old proxy format

* chore: add a fetch spec test with a local proxy

* chore: add fresh sendRequest tests

* fix: TS issue

* chore: bring back all the old sendRequest tests

* fix: localhost url has https

* docs(changeset): feat: [BREAKING CHANGE] use new HTTP proxy (#1703)

* chore: enable deprecation warning

* fix: cors headers are merged to invalid values

* fix: ApiClient component requires withDefaultFonts property

* chore: improve the deprecation warning

* refactor: better render response bodies

* feat: add /404 route to the echo server

* feat: handle network errors in the proxy

* chore: add test for the /404 route

* feat: better error handling

* chore: code style

* feat: skip proxy for requests to localhost

* fix: tests still expect JSON strings

* chore: write another test for the error handling

* fix: TS issue

* fix: test

* chore: update lock file

* fix: proxy deprecation warnings appear in local environment

* chore: improve no preview available wording

* feat: show network errors in the code block

* chore: make response body less error prone

* feat: show axios error in console

* fix: variables in urls aren’t replaced

* tests: variables in URLs are replaced properly

* fix: tests

* test: urls with slashes and pathes with slashes shouldn’t be concatenated with a duplicate slash

* refactor: new normalizeHeaders helper

* chore: update lock file

---------

Co-authored-by: Hans Pagel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants