You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: if Content-Type header defined, don't overwrite with default
When processing a template, you should be able to set the content-type
header using:
tal:replace="python:request.client.additional_headers.update(
{'Content-Type':'application/vnd.roundup.translation+json'}
)"
The client used to always overwrite it with the content type derived
from the template extension or text/html for unknown extensions. This
patch stops the overwriting if the Content-Type is already set in the
header.
This particular use case was to use an XML document to process a url
like:
/tracker?@template=translation+json&tokens=Login,Welcome+%s
and get back json data of the translated strings. If the file was
named '_generic.json' and we used '@template=json' we got
application/json returned. For other template names we got text/html.
0 commit comments