mirror of
https://github.com/rclone/rclone.git
synced 2026-01-05 18:13:17 +00:00
config: fix problem reading pasted tokens over 4095 bytes
Before this change we were reading input from stdin using the terminal
in the default line mode which has a limit of 4095 characters.
The typical culprit was onedrive tokens (which are very long) giving the error
Couldn't decode response: invalid character 'e' looking for beginning of value
This change swaps over to use the github.com/peterh/liner read line
library which does not have that limitation and also enables more
sensible cursor editing.
Fixes #8688 #8323 #5835
This commit is contained in:
@@ -85,9 +85,9 @@ func testConfigFile(t *testing.T, options []fs.Option, configFileName string) fu
|
||||
|
||||
// makeReadLine makes a simple readLine which returns a fixed list of
|
||||
// strings
|
||||
func makeReadLine(answers []string) func() string {
|
||||
func makeReadLine(answers []string) func(string) string {
|
||||
i := 0
|
||||
return func() string {
|
||||
return func(string) string {
|
||||
i++
|
||||
return answers[i-1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user