It might be useful to turn this into an error handler as well, so for example if the container fails to download the sp.js from the SP CDN, then sendResponse() could be called with a 404 status code, which is then set as the response status before the response is sent back.
https://github.com/snowplow-incubator/snowplow-gtm-server-side-client/blob/0d83bf24eec697eb2f8cf15b777a08b26d173e0d/template.tpl#L171
It might be useful to turn this into an error handler as well, so for example if the container fails to download the sp.js from the SP CDN, then sendResponse() could be called with a 404 status code, which is then set as the response status before the response is sent back.