I’d probably do this differently, as documented in our article on the topic:
You definitely don’t have to use make and sed, but you DO need to:
set per-context build commands to manage your headers differently (I like “no headers” by default and applying the headers in branch deploys and/or deploy preview contexts, but you can do it however you like)
keep that header in _headers rather than in netlify.toml, since there are no context-specific headers; everything in that file is used for every deploy, as you found