-
-
Notifications
You must be signed in to change notification settings - Fork 663
[Feature]: Add http_response Lua hook to allow customization of HTTP responses #2395
Copy link
Copy link
Open
Labels
display: httprelated to HTTP backendrelated to HTTP backendfeaturesuggest addition of new functionality that isn't currently supported in any waysuggest addition of new functionality that isn't currently supported in any waygood first issuestraightforward enough for first-time contributors to be able to implement themselvesstraightforward enough for first-time contributors to be able to implement themselvesluarelated to Lua integration in conkyrelated to Lua integration in conky
Description
Metadata
Metadata
Assignees
Labels
display: httprelated to HTTP backendrelated to HTTP backendfeaturesuggest addition of new functionality that isn't currently supported in any waysuggest addition of new functionality that isn't currently supported in any waygood first issuestraightforward enough for first-time contributors to be able to implement themselvesstraightforward enough for first-time contributors to be able to implement themselvesluarelated to Lua integration in conkyrelated to Lua integration in conky
When using HTTP backend, Conky currently hardcodes a somewhat crude HTML response.
#2394 fixes a deadlock with formatting that was reported in #1649 by introducing a mutex for the string passed to
microhttpd. This mutex was coincidentally a missing feature that was needed to sync Lua tosendanswerused bymicrohttpd.It's possible now to let users generate the response they want the HTTP backend producing.
It would be ideal if the hook return value was a table that also includes headers besides just the content body - that would allow e.g. JSON responses.
I'm assuming that's what @ctrlcctrlv was proposing in #1649,