Skip to content

fix: Strip HTML from error strings#1059

Open
Pecacheu wants to merge 1 commit intostoatchat:mainfrom
Pecacheu:errorfix
Open

fix: Strip HTML from error strings#1059
Pecacheu wants to merge 1 commit intostoatchat:mainfrom
Pecacheu:errorfix

Conversation

@Pecacheu
Copy link
Contributor

Now ideally the Stoat backend should just not send API errors in HTML format to begin with (but as raw text or JSON, for instance) because it wastes network bandwidth, but hey, stripping it on the frontend also helps in case any HTML-formatted errors from other sources slip through the cracks. Which- if other people's error report screenshots are anything to go by- happens a lot.

Old:

New:

Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>
@Pecacheu Pecacheu requested review from a team as code owners March 24, 2026 16:38
@Zomatree
Copy link
Member

If the client adds Accept: application/json the api will return json errors for all errors.

@Pecacheu
Copy link
Contributor Author

If the client adds Accept: application/json the api will return json errors for all errors.

Ah, good to know. I assume that's a change for stoat.js and not for-web though?

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

Successfully merging this pull request may close these issues.

2 participants