ord icon indicating copy to clipboard operation
ord copied to clipboard

Cookie file parsing doesn't ignore trailing whitespace / newlines

Open Randy808 opened this issue 2 years ago • 2 comments

When testing this out I was getting an error because of a trailing newline in my .cookie file

Randy808 avatar Feb 12 '23 17:02 Randy808

Is there are standard situation where you can encounter whitespace on that line?

The relevant location to fix this is upstream on https://github.com/casey/rust-bitcoincore-rpc/blob/9e6dff79fadd6ae472e51165b0064ebed97aad95/client/src/client.rs#L213 A simple trim() would resolve this if the cause is something that is likely to be a recurring problem with users.

Psifour avatar Feb 13 '23 00:02 Psifour

Yes, when making a .cookie file due to lack of support for #1399 (because I imagine most people have a configured bitcoin.conf). I imagine this will be a recurring problem until there's support for rpc_user and rpc_pass so it may be worth adding

Randy808 avatar Feb 18 '23 14:02 Randy808