mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-29 23:06:24 +02:00
add String method to Request
This commit is contained in:
parent
fc093b71eb
commit
b1de3a9dd6
2 changed files with 9 additions and 6 deletions
8
data.go
8
data.go
|
|
@ -186,6 +186,14 @@ type Request struct {
|
|||
Options Options // Image transformation to perform
|
||||
}
|
||||
|
||||
// String returns the request URL as a string, with r.Options encoded in the
|
||||
// URL fragment.
|
||||
func (r Request) String() string {
|
||||
u := *r.URL
|
||||
u.Fragment = r.Options.String()
|
||||
return u.String()
|
||||
}
|
||||
|
||||
// NewRequest parses an http.Request into an imageproxy Request. Options and
|
||||
// the remote image URL are specified in the request path, formatted as:
|
||||
// /{options}/{remote_url}. Options may be omitted, so a request path may
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue