]> git.kaiwu.me - njs.git/commit
Fetch: fixed setting of Content-Type header.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 22 Jun 2023 22:40:36 +0000 (15:40 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 22 Jun 2023 22:40:36 +0000 (15:40 -0700)
commit5b463b8050377216ad4197cd1e35bb69b35b77e9
treeb21ee0e101940cc7af806a184c79d4ec32818e61
parent295213f8a51c3ebaf4e9c4fcedda13477378708b
Fetch: fixed setting of Content-Type header.

Previously, Content-Type was set unconditionally to
"text/plain;charset=UTF-8" when fetch request contained a string body.
This may overlap with user's Content-Type.

The fix is to set the header only if it was not set before.

This fixes #654 issue on Github.
nginx/ngx_js_fetch.c
nginx/t/js_fetch_objects.t