Something went wrong while fetching comments. Please try again.
Created by: slimsag
This change has no effect, the behavior is identical before and after. Instead, the actual change in behavior will come in a subsequent PR. All this does is make scureHeadersMiddleware
aware of what type of route it is protecting-what cross origin request policy it should be enforcing.
This is needed to improve security in various ways:
Note that there is one small behavior change, the secure middleware headers will now run after the following middlewares:
h = middleware.Trace(h)
h = gcontext.ClearHandler(h)
h = healthCheckMiddleware(h)
It is 100% OK to do this because:
gcontext.ClearHandler
executes once the request has finished (deferred execution),
so it's behavior does not actually change.Helps sourcegraph/security-issues#176
Signed-off-by: Stephen Gutekanst stephen@sourcegraph.com