http_options.response.headers is a newish option for Fly
doesn’t work or ambiguous if global header change was observed Mar 2022 Changing X-Frame-Options to allow-from doesn't succeed in .toml file - #6 by fideloper-fly
doesnt work Apr 2022 New Feature: Basic HTTP response header modification
works Oct 2022 Format of `services.ports.http_options.response.headers` in `fly.toml`
broken jan 2023 Resource blocked due to MIME type mismatch
the breakage acknowledged ( How to remove headers from fly.io proxy response? - #2 by fideloper-fly (Apr 2023), then fixed ( Port services.ports.http_options to v2 apps by dangra · Pull Request #2169 · superfly/flyctl · GitHub Apr 2023 ), then more breakage from the community
So now in Aug 2023 I tried using it, made a test fly node project, GitHub - bulk88/ftest: flyio header test
# fly.toml app configuration file generated for ftest on 2023-08-23T21:23:47+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = "ftest"
primary_region = "ewr"
[build]
[env]
PORT = "3000"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[http_service.http_options.response.headers]
fly-request-id = false
fly-wasnt-here = "yes, it was"
multi-valued = ["value1", "value2"]
Echo-ing fly.toml back out shows it was parsed
root# fly config show
{
"app": "ftest",
"primary_region": "ewr",
"env": {
"PORT": "3000"
},
"http_service": {
"internal_port": 3000,
"force_https": true,
"auto_stop_machines": true,
"auto_start_machines": true,
"min_machines_running": 0,
"processes": [
"app"
],
"http_options": {
"response": {
"headers": {
"fly-request-id": false,
"fly-wasnt-here": "yes, it was",
"multi-valued": [
"value1",
"value2"
]
}
}
}
}
}
root#
I am using flyctl 0.1.84. These add/remove response header options have no effect for me on this basic sample project. I am on an IPv4 ISP connection, and since I am free/hobby tier, I know I have to be going through the Fly HTTP edge proxy. Can anyone else try to use http_options.response.headers and see if this feature works at all? I’d like to eliminate the static (and unimportant) server and via headers atleast if possible. Maybe fly-request-id also but I’d understand if thats a technical hard no for Fly.io.
Request URL: https://ftest.fly.dev/
Request Method: GET
Status Code: 200
Remote Address: 66.241.125.51:443
Referrer Policy: strict-origin-when-cross-origin
content-encoding: gzip
content-type: text/html
date: Wed, 23 Aug 2023 23:04:54 GMT
fly-request-id: 01H8JA9K3RECZYZBJTS7KTY7SR-lga
server: Fly/0bc70000 (2023-08-16)
via: 2 fly.io