1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add new fields for feed username/password

This commit is contained in:
Frédéric Guillot 2018-06-19 22:58:29 -07:00
parent 261695c14c
commit bddca15b69
27 changed files with 203 additions and 68 deletions

View file

@ -52,8 +52,10 @@ type Client struct {
// WithCredentials defines the username/password for HTTP Basic authentication.
func (c *Client) WithCredentials(username, password string) *Client {
c.username = username
c.password = password
if username != "" && password != "" {
c.username = username
c.password = password
}
return c
}
@ -159,7 +161,7 @@ func (c *Client) executeRequest(request *http.Request) (*Response, error) {
ContentLength: resp.ContentLength,
}
logger.Debug("[HttpClient:%s] URL=%s, EffectiveURL=%s, Code=%d, Length=%d, Type=%s, ETag=%s, LastMod=%s, Expires=%s",
logger.Debug("[HttpClient:%s] URL=%s, EffectiveURL=%s, Code=%d, Length=%d, Type=%s, ETag=%s, LastMod=%s, Expires=%s, Auth=%v",
request.Method,
c.url,
response.EffectiveURL,
@ -169,6 +171,7 @@ func (c *Client) executeRequest(request *http.Request) (*Response, error) {
response.ETag,
response.LastModified,
resp.Header.Get("Expires"),
c.username != "",
)
// Ignore caching headers for feeds that do not want any cache.