1
0
Fork 0
mirror of https://github.com/Luzifer/vault-openvpn.git synced 2024-11-09 16:50:04 +00:00

Fixes error when '~/.vault-token' contains a trailing newline

First of all, thanks for the great tool!

This PR fixes an error encountered by one of our developers which occured when they had manually created the `~/.vault-token` file, and their editor had added a trailing newline. The error comes from the following line: https://github.com/hashicorp/vault/blob/master/api/client.go#L747

The official vault client was patched for this in f8c657a80a, after issues https://github.com/hashicorp/vault/issues/1774 and https://github.com/hashicorp/vault/issues/1902.
This commit is contained in:
Jason Gwartz 2019-05-02 16:46:09 +02:00 committed by Knut Ahlers
parent 4d1d07b3c3
commit 66ccd94069

View file

@ -116,5 +116,5 @@ func vaultTokenFromDisk() string {
return "" return ""
} }
return string(data) return strings.TrimSpace(string(data))
} }