mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1512] do not escape JSON response #1625
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1625
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/1512
Author: @wunter8
Created: 12/7/2025
Status: 🔄 Open
Base:
main← Head:1511-ampersand📝 Commits (1)
fb89b87do not escape JSON response📊 Changes
2 files changed (+12 additions, -4 deletions)
View changed files
📝
server/server.go(+9 -3)📝
server/server_matrix.go(+3 -1)📄 Description
Apparently, golang's JSON encoder automatically escapes
<,&, and>in a JSON response (See https://github.com/golang/go/issues/28453 and https://pkg.go.dev/encoding/json#Encoder.SetEscapeHTML).This was unexpected to me. It seems like whoever is using the returned ntfy message should choose to escape the data if they want to before they use it, instead of ntfy always escaping the data.
Before the change,
curl -d '&' https://ntfy.sh/testwould return{..."message":"\u0026"...}After the change,
curl -d '&' https://ntfy.sh/testreturns{..."message":"&"...}Fixes #1511
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.