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
CORS headers were originally added by 6d5bdff.
These headers could be set without any Authz plugin enabled
beforehand, making this feature quite dangerous.
This commit marks the daemon flag `api-cors-header` as deprecated
and requires the env var `DOCKERD_DEPRECATED_CORS_HEADER` to be
set. When enabled, the daemon will write a deprecation warning to
the logs and the endpoint `GET /info` will return the same
deprecation warning.
Signed-off-by: Albin Kerouanton <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
logrus.Warnf(`DEPRECATED: The "api-cors-header" config parameter and the dockerd "--api-cors-header" option will be removed in the next release. Use a reverse proxy if you need CORS headers.`)
734
+
c:=middleware.NewCORSMiddleware(cfg.CorsHeaders) //nolint:staticcheck // ignore SA1019 (NewCORSMiddleware is deprecated); will be removed in the next release.
CorsHeadersstring`json:"api-cors-header,omitempty"`// Deprecated: CORS headers should not be set on the API. This feature will be removed in the next release.
164
164
165
165
// Proxies holds the proxies that are configured for the daemon.
to the 'Docker daemon attack surface' section in the documentation for
236
236
more information: https://docs.docker.com/go/attack-surface/`
237
237
238
+
ifcfg.CorsHeaders!="" {
239
+
v.Warnings=append(v.Warnings, `DEPRECATED: The "api-cors-header" config parameter and the dockerd "--api-cors-header" option will be removed in the next release. Use a reverse proxy if you need CORS headers.`)
240
+
}
241
+
238
242
for_, host:=rangecfg.Hosts {
239
243
// cnf.Hosts is normalized during startup, so should always have a scheme/proto
0 commit comments