File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"encoding/json"
6
6
"fmt"
7
- "io"
8
7
"net/http"
9
8
"strings"
10
9
"time"
@@ -193,15 +192,11 @@ func (c *Client) HasFirstUser(ctx context.Context) (bool, error) {
193
192
defer res .Body .Close ()
194
193
195
194
if res .StatusCode == http .StatusNotFound {
196
- b , err := io .ReadAll (res .Body )
197
- if err != nil {
198
- return false , err
199
- }
200
195
// ensure we are talking to coder and not
201
196
// some other service that returns 404
202
- isCoder := strings . Contains ( string ( b ), "initial user has not been created " )
203
- if ! isCoder {
204
- return false , xerrors .Errorf ("unexpected response: %s" , string ( b ) )
197
+ v := res . Header . Get ( "X-Coder-Build-Version " )
198
+ if v == "" {
199
+ return false , xerrors .Errorf ("missing build version header, not a coder instance" )
205
200
}
206
201
207
202
return false , nil
You can’t perform that action at this time.
0 commit comments