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

Add text/plain content-type option for POST /message endpoint #547

Closed
scottmconway opened this issue Feb 14, 2023 · 3 comments
Closed

Add text/plain content-type option for POST /message endpoint #547

scottmconway opened this issue Feb 14, 2023 · 3 comments
Labels
a:feature New feature or request

Comments

@scottmconway
Copy link

Is your feature request related to a problem? Please describe.
I'm attempting to log content that I cannot sanitize into Gotify. My options are to call the /message endpoint with one of application/json, application/x-www-form-urlencoded, or multipart/form-data content-types. As the unsanitized input could contain control characters for any of those methods, logging the message to gotify will not be reliable.

Describe the solution you'd like
I'd like to be able to specify text/plain as the content-type, and treat the entire HTTP body as the value of message. This would limit the declaration of other values (title, priority, etc) unless they could be read from GET parameters. Nonetheless, it would allow for the logging of unsanitized messages.

Describe alternatives you've considered
Proper sanitization sadly isn't an option here... But ntfy.sh does support plain-text messaging.

@scottmconway scottmconway added the a:feature New feature or request label Feb 14, 2023
@scottmconway scottmconway changed the title Add text/plain content-type option for /message endpoint Add text/plain content-type option for POST /message endpoint Feb 14, 2023
@jmattheis
Copy link
Member

Why is sanitization on your side not an option?

@scottmconway
Copy link
Author

It relates to this issue in Easer (similar to Tasker) for Android. Essentially, Easer allows you to reference "dynamics" (such as text message content) by name in network requests and other actions, but you can't post-process them. Without changing Easer, the only foolproof way to perform sanitization that I can think of would be to proxy the request through my own "sanitization forwarder" that would accept plaintext, and forward the message to gotify in a properly escaped JSON. I'd just really rather not go with that approach, as it adds another moving part to my logging infrastructure.

@jmattheis
Copy link
Member

Hmm, I'm not sure if I want to support this, most other tools that support sending http requests can build a proper request themselves. I don't think it's gotify's responsibility to workaround this missing functionality from Easer.

@jmattheis jmattheis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Development

No branches or pull requests

2 participants