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

fetchJSON removes security prefix on 200 response but not on fetch error cases #1974

Open
gabrielslach opened this issue May 2, 2023 · 0 comments

Comments

@gabrielslach
Copy link

Expected behavior

fetchJSON should return valid JSON for all types of response (regardless if response code of 200 or not)

Actual Behavior

  • fetchJSON returns valid JSON only on successful requests (response code 200). In cases where the response body is prefixed by a security substring, the prefix is removed before the response body is returned.

image

  • However, in cases where fetch() throws an error and the (error) response body is prefixed by a security substring, the prefix is not removed.

  • Issue is that the handling of the security prefix (for error responses) would need to be implemented again/separately outside the package.

  • Since for successful response, fetchJSON handles the removal of the security prefix, shouldn't it also do the same for error responses?

Additional context

ajax: 1.0.0

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