diff --git a/policy.go b/policy.go
index 8a08163..1a5e00c 100644
--- a/policy.go
+++ b/policy.go
@@ -707,7 +707,7 @@ func (p *Policy) AllowURLSchemeWithCustomPolicy(
func (p *Policy) RequireSandboxOnIFrame(vals ...SandboxValue) {
p.requireSandboxOnIFrame = make(map[string]bool)
- for val := range vals {
+ for _, val := range vals {
switch SandboxValue(val) {
case SandboxAllowDownloads:
p.requireSandboxOnIFrame["allow-downloads"] = true
diff --git a/sanitize_test.go b/sanitize_test.go
index fa9e641..a90248e 100644
--- a/sanitize_test.go
+++ b/sanitize_test.go
@@ -1874,10 +1874,10 @@ func TestIssue107(t *testing.T) {
func TestIFrameSandbox(t *testing.T) {
p := NewPolicy()
p.AllowAttrs("sandbox").OnElements("iframe")
- p.RequireSandboxOnIFrame(SandboxAllowDownloads)
+ p.RequireSandboxOnIFrame(SandboxAllowForms, SandboxAllowPopups)
- in := ``
- expected := ``
+ in := ``
+ expected := ``
out := p.Sanitize(in)
if out != expected {
t.Errorf(