From 94ca8979ffddda23c645c80ff32ae708206bf94b Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 3 Aug 2022 17:22:01 +0200 Subject: Do not display password on status line Editing the URL still does. --- src/io/buffer.nim | 2 +- src/types/url.nim | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/io/buffer.nim b/src/io/buffer.nim index 5a475f96..479297d5 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -308,7 +308,7 @@ func getTitle(buffer: Buffer): string = if result != "": return result if buffer.ispipe: return "*pipe*" - return $buffer.location + return buffer.location.serialize(excludepassword = true) proc clearDisplay(buffer: Buffer) = buffer.prevdisplay = buffer.display diff --git a/src/types/url.nim b/src/types/url.nim index fd1aa201..f86bdc01 100644 --- a/src/types/url.nim +++ b/src/types/url.nim @@ -815,13 +815,13 @@ func serialize_unicode_dos*(path: UrlPath): string {.inline.} = result &= percentDecode(s) inc i -func serialize*(url: Url, excludefragment = false): string = +func serialize*(url: Url, excludefragment = false, excludepassword = false): string = result = url.scheme & ':' if url.host.issome: result &= "//" if url.includes_credentials: result &= url.username - if url.password != "": + if not excludepassword and url.password != "": result &= ':' & url.password result &= '@' result &= url.host.get.serialize -- cgit