@@ -19,6 +19,8 @@ import (
19
19
"github.com/coder/coder/v2/codersdk"
20
20
)
21
21
22
+ type HTTPResponseCode = int
23
+
22
24
func (a * agent ) HandleReadFile (rw http.ResponseWriter , r * http.Request ) {
23
25
ctx := r .Context ()
24
26
@@ -45,7 +47,7 @@ func (a *agent) HandleReadFile(rw http.ResponseWriter, r *http.Request) {
45
47
}
46
48
}
47
49
48
- func (a * agent ) streamFile (ctx context.Context , rw http.ResponseWriter , path string , offset , limit int64 ) (int , error ) {
50
+ func (a * agent ) streamFile (ctx context.Context , rw http.ResponseWriter , path string , offset , limit int64 ) (HTTPResponseCode , error ) {
49
51
if ! filepath .IsAbs (path ) {
50
52
return http .StatusBadRequest , xerrors .Errorf ("file path must be absolute: %q" , path )
51
53
}
@@ -125,7 +127,7 @@ func (a *agent) HandleWriteFile(rw http.ResponseWriter, r *http.Request) {
125
127
})
126
128
}
127
129
128
- func (a * agent ) writeFile (ctx context.Context , r * http.Request , path string ) (int , error ) {
130
+ func (a * agent ) writeFile (ctx context.Context , r * http.Request , path string ) (HTTPResponseCode , error ) {
129
131
if ! filepath .IsAbs (path ) {
130
132
return http .StatusBadRequest , xerrors .Errorf ("file path must be absolute: %q" , path )
131
133
}
0 commit comments