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

[BYOM] Handle Invalid Response Formats #43488

Open
3 of 6 tasks
jonathansampson opened this issue Jan 25, 2025 · 0 comments · May be fixed by brave/brave-core#27345
Open
3 of 6 tasks

[BYOM] Handle Invalid Response Formats #43488

jonathansampson opened this issue Jan 25, 2025 · 0 comments · May be fixed by brave/brave-core#27345

Comments

@jonathansampson
Copy link
Contributor

Description

Brave presently does only a superficial check against the format of the response when determining if it is valid or not. As a result, if a response contains a mostly-valid structure, but doesn't contain a "content" key on the first message, Brave will fail to handle this properly.

Steps to reproduce

Configure a server to respond with the following:

{"choices":[{"message":{"not_content":"value"}}]}

Actual result

The browser process will crash due to the absence of a "content" key.

Expected result

Brave should handle this more gracefully, and inform the user (at the very least) that the response format was invalid or otherwise unexpected.

Reproduces how often

Easily reproduced

Brave version (brave://version info)

1.74.50 Chromium: 132.0.6834.111 (Official Build) (64-bit)

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant