Skip to content

Commit

Permalink
warn about missing --yamux flag instead of error
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed May 29, 2024
1 parent 6781bbd commit 966bdc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions cmd/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ func clientHandleWithYamux(ln net.Listener, httpClient *http.Client, headers []p
return nil, err
}
contentType := res.Header.Get("Content-Type")
// NOTE: application/octet-stream is for compatibility
if contentType != cmd.YamuxMimeType && contentType != "application/octet-stream" {
return nil, errors.Errorf("invalid content-type: %s", contentType)
if contentType != cmd.YamuxMimeType {
fmt.Printf("[INFO] --%s flag may be missing in server-host\n", cmd.YamuxFlagLongName)
}
return res, nil
},
Expand Down
5 changes: 2 additions & 3 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ func serverHandleWithYamux(httpClient *http.Client, headers []piping_util.KeyVal
return nil, err
}
contentType := res.Header.Get("Content-Type")
// NOTE: application/octet-stream is for compatibility
if contentType != cmd.YamuxMimeType && contentType != "application/octet-stream" {
return nil, errors.Errorf("invalid content-type: %s", contentType)
if contentType != cmd.YamuxMimeType {
fmt.Printf("[WARN] --%s flag may be missing in client-host\n", cmd.YamuxFlagLongName)
}
return res, nil
},
Expand Down

0 comments on commit 966bdc3

Please sign in to comment.