File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -707,7 +707,7 @@ func (p *Policy) AllowURLSchemeWithCustomPolicy(
707707func (p * Policy ) RequireSandboxOnIFrame (vals ... SandboxValue ) {
708708 p .requireSandboxOnIFrame = make (map [string ]bool )
709709
710- for val := range vals {
710+ for _ , val := range vals {
711711 switch SandboxValue (val ) {
712712 case SandboxAllowDownloads :
713713 p .requireSandboxOnIFrame ["allow-downloads" ] = true
Original file line number Diff line number Diff line change @@ -1874,10 +1874,10 @@ func TestIssue107(t *testing.T) {
18741874func TestIFrameSandbox (t * testing.T ) {
18751875 p := NewPolicy ()
18761876 p .AllowAttrs ("sandbox" ).OnElements ("iframe" )
1877- p .RequireSandboxOnIFrame (SandboxAllowDownloads )
1877+ p .RequireSandboxOnIFrame (SandboxAllowForms , SandboxAllowPopups )
18781878
1879- in := `<iframe src="http://example.com" sandbox="allow-forms allow-downloads allow-downloads"></iframe>`
1880- expected := `<iframe sandbox="allow-downloads "></iframe>`
1879+ in := `<iframe src="http://example.com" sandbox="allow-forms allow-downloads allow-downloads allow-popups "></iframe>`
1880+ expected := `<iframe sandbox="allow-forms allow-popups "></iframe>`
18811881 out := p .Sanitize (in )
18821882 if out != expected {
18831883 t .Errorf (
You can’t perform that action at this time.
0 commit comments