aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-10-17 16:52:16 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-10-18 18:36:04 +0200
commit44ff3d08a0e1f3b49e07795a9fdb0ad3af4c7540 (patch)
treecebad37bcb517d2ba99e3923d9cb725f831f82e5 /pkg
parent925683b5810a3707831a30ac59a7a446af21c5f1 (diff)
downloadfeed2imap-go-44ff3d08a0e1f3b49e07795a9fdb0ad3af4c7540.tar.gz
feed2imap-go-44ff3d08a0e1f3b49e07795a9fdb0ad3af4c7540.tar.bz2
feed2imap-go-44ff3d08a0e1f3b49e07795a9fdb0ad3af4c7540.zip
URL: Do not print '@' when no user is given
Diffstat (limited to '')
-rw-r--r--pkg/config/url.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/config/url.go b/pkg/config/url.go
index 9621672..39cce16 100644
--- a/pkg/config/url.go
+++ b/pkg/config/url.go
@@ -64,12 +64,18 @@ func (u *Url) UnmarshalYAML(value *yaml.Node) (err error) {
}
func (u *Url) String() string {
+ scheme := u.Scheme + "://"
+
var pwd string
if u.Password != "" {
pwd = ":******"
}
+ var delim string
+ if pwd != "" || u.User != "" {
+ delim = "@"
+ }
- return fmt.Sprintf("%s://%s%s@%s%s", u.Scheme, u.User, pwd, u.HostPort(), u.Root)
+ return scheme + u.User + pwd + delim + u.HostPort() + u.Root
}
func (u *Url) HostPort() string {
0200'>2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12