Skip to content

Commit

Permalink
Specified context of use for the RewriteSrc func
Browse files Browse the repository at this point in the history
  • Loading branch information
yyewolf committed Jul 18, 2023
1 parent fb590ac commit f39f383
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ func (p *Policy) AllowURLSchemesMatching(r *regexp.Regexp) *Policy {

// RewriteSrc will rewrite the src attribute of a resource downloading tag
// (e.g. <img>, <script>, <iframe>) using the provided function.
//
// For a mail provider, this can be used to proxify requests and prevent
// the sender from learning the IP address of the recipient and / or
// whether the recipient has opened the email (and when / how often).
func (p *Policy) RewriteSrc(fn urlRewriter) *Policy {
p.srcRewriter = fn
return p
Expand Down

0 comments on commit f39f383

Please sign in to comment.