|
@@ -21,7 +21,6 @@ import (
|
|
|
"miniflux.app/errors"
|
|
"miniflux.app/errors"
|
|
|
"miniflux.app/logger"
|
|
"miniflux.app/logger"
|
|
|
"miniflux.app/timer"
|
|
"miniflux.app/timer"
|
|
|
- url_helper "miniflux.app/url"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
@@ -40,7 +39,6 @@ var (
|
|
|
type Client struct {
|
|
type Client struct {
|
|
|
inputURL string
|
|
inputURL string
|
|
|
|
|
|
|
|
- requestURL string
|
|
|
|
|
requestEtagHeader string
|
|
requestEtagHeader string
|
|
|
requestLastModifiedHeader string
|
|
requestLastModifiedHeader string
|
|
|
requestAuthorizationHeader string
|
|
requestAuthorizationHeader string
|
|
@@ -90,9 +88,8 @@ func (c *Client) String() string {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf(
|
|
return fmt.Sprintf(
|
|
|
- `InputURL=%q RequestURL=%q ETag=%s LastMod=%s Auth=%v UserAgent=%q Verify=%v`,
|
|
|
|
|
|
|
+ `InputURL=%q ETag=%s LastMod=%s Auth=%v UserAgent=%q Verify=%v`,
|
|
|
c.inputURL,
|
|
c.inputURL,
|
|
|
- c.requestURL,
|
|
|
|
|
etagHeader,
|
|
etagHeader,
|
|
|
lastModifiedHeader,
|
|
lastModifiedHeader,
|
|
|
c.requestAuthorizationHeader != "" || (c.requestUsername != "" && c.requestPassword != ""),
|
|
c.requestAuthorizationHeader != "" || (c.requestUsername != "" && c.requestPassword != ""),
|
|
@@ -263,8 +260,7 @@ func (c *Client) executeRequest(request *http.Request) (*Response, error) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, error) {
|
|
func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, error) {
|
|
|
- c.requestURL = url_helper.RequestURI(c.inputURL)
|
|
|
|
|
- request, err := http.NewRequest(method, c.requestURL, body)
|
|
|
|
|
|
|
+ request, err := http.NewRequest(method, c.inputURL, body)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|