proxy.go 515 B

123456789101112131415161718
  1. // Copyright 2020 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package proxy // import "miniflux.app/proxy"
  5. import (
  6. "encoding/base64"
  7. "miniflux.app/http/route"
  8. "github.com/gorilla/mux"
  9. )
  10. // ProxifyURL generates an URL for a proxified resource.
  11. func ProxifyURL(router *mux.Router, link string) string {
  12. return route.Path(router, "proxy", "encodedURL", base64.URLEncoding.EncodeToString([]byte(link)))
  13. }