File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -129,13 +129,13 @@ func start() *cobra.Command {
129
129
}
130
130
logger := slog .Make (sloghuman .Sink (os .Stderr ))
131
131
options := & coderd.Options {
132
- AccessURL : accessURLParsed ,
133
- Logger : logger .Named ("coderd" ),
134
- Database : databasefake .New (),
135
- Pubsub : database .NewPubsubInMemory (),
136
- GoogleTokenValidator : validator ,
137
- HSTS : strictTransportSecurity ,
138
- SecureCookie : secureCookie ,
132
+ AccessURL : accessURLParsed ,
133
+ Logger : logger .Named ("coderd" ),
134
+ Database : databasefake .New (),
135
+ Pubsub : database .NewPubsubInMemory (),
136
+ GoogleTokenValidator : validator ,
137
+ StrictTransportSecurity : strictTransportSecurity ,
138
+ SecureCookie : secureCookie ,
139
139
}
140
140
141
141
if ! dev {
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ type Options struct {
30
30
AWSCertificates awsidentity.Certificates
31
31
GoogleTokenValidator * idtoken.Validator
32
32
33
- HSTS bool
34
- SecureCookie bool
33
+ StrictTransportSecurity bool
34
+ SecureCookie bool
35
35
}
36
36
37
37
// New constructs the Coder API into an HTTP handler.
@@ -50,7 +50,7 @@ func New(options *Options) (http.Handler, func()) {
50
50
r .Route ("/api/v2" , func (r chi.Router ) {
51
51
r .Use (
52
52
chitrace .Middleware (),
53
- httpmw .HSTS (api .HSTS ),
53
+ httpmw .StrictTransportSecurity (api .StrictTransportSecurity ),
54
54
)
55
55
r .Get ("/" , func (w http.ResponseWriter , r * http.Request ) {
56
56
httpapi .Write (w , http .StatusOK , httpapi.Response {
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import (
6
6
"net/http/httptest"
7
7
"testing"
8
8
9
- "github.com/coder/coder/coderd/httpmw"
10
9
"github.com/go-chi/chi/v5"
11
10
"github.com/stretchr/testify/require"
11
+
12
+ "github.com/coder/coder/coderd/httpmw"
12
13
)
13
14
14
15
func TestStrictTransportSecurity (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments