GitHub user sebbASF opened an issue:
https://github.com/apache/incubator-ponymail/issues/218
Bug: lua scripts not using cross.contentType() compatibility function
The cross.lua nginx compatibility module defines the function contentType()
for use when setting the content_type.
However only atom.lua currently uses it, all the others set the field
directly:
```
site/api/atom.lua
67: cross.contentType(r, "application/xhtml+xml")
site/api/compose.lua
30: r.content_type = "application/json"
...
```
Rather than fix the source code, it occurs to me that it should be possible
to fix this using a metatable on the "r" table which cross.lua creates for
nginx. This would result in neater code, as well as allowing errors to be
generated as necessary for other request_rec attributes [1]
[1] https://httpd.apache.org/docs/2.4/mod/mod_lua.html#datastructures
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---