mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
tsweb: add copyright header
And fix an unlikely but potential crash.
This commit is contained in:
parent
a567c56971
commit
c706731dc7
@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package tsweb
|
||||
|
||||
import (
|
||||
@ -36,8 +40,7 @@ func (m Msg) String() string {
|
||||
}
|
||||
var buf strings.Builder
|
||||
json.NewEncoder(&buf).Encode(m)
|
||||
ret := buf.String()
|
||||
return ret[:len(ret)-1] // remove trailing newline
|
||||
return strings.TrimRight(buf.String(), "\n")
|
||||
}
|
||||
|
||||
// HTTPError is an error with embedded HTTP response information.
|
||||
|
Loading…
Reference in New Issue
Block a user