mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
refactor(ui): standardize user variable naming and avoid a SQL query when only userID
is used
- Use `user` everywhere, instead of sometimes `loggedUser` - Delay the instantiation of some variables: no need to perform SQL queries for nothing. - Remove a SQL query getting the whole user struct when only user.ID is used.
This commit is contained in:
parent
50c5996280
commit
5d9d0b2652
11 changed files with 50 additions and 57 deletions
|
@ -30,13 +30,13 @@ func (h *handler) mediaProxy(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
encodedDigest := request.RouteStringParam(r, "encodedDigest")
|
||||
encodedURL := request.RouteStringParam(r, "encodedURL")
|
||||
if encodedURL == "" {
|
||||
html.BadRequest(w, r, errors.New("no URL provided"))
|
||||
return
|
||||
}
|
||||
|
||||
encodedDigest := request.RouteStringParam(r, "encodedDigest")
|
||||
decodedDigest, err := base64.URLEncoding.DecodeString(encodedDigest)
|
||||
if err != nil {
|
||||
html.BadRequest(w, r, errors.New("unable to decode this digest"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue