Bird
0
0

What will happen if you set the X-Frame-Options header to DENY in a Flask app?

medium📝 Conceptual Q5 of 15
Flask - Security Best Practices
What will happen if you set the X-Frame-Options header to DENY in a Flask app?
AThe page cannot be displayed in any frame or iframe
BThe page can be framed by any site
CThe page will only allow framing from the same origin
DThe header will be ignored by browsers
Step-by-Step Solution
Solution:
  1. Step 1: Understand X-Frame-Options values

    Setting it to DENY blocks all framing of the page.
  2. Step 2: Compare with other options

    ALLOW-FROM allows specific origins, SAMEORIGIN allows same origin framing, ignoring is not standard behavior.
  3. Final Answer:

    The page cannot be displayed in any frame or iframe -> Option A
  4. Quick Check:

    X-Frame-Options DENY = block all framing [OK]
Quick Trick: DENY blocks all framing of the page [OK]
Common Mistakes:
MISTAKES
  • Confusing DENY with SAMEORIGIN
  • Thinking DENY allows framing
  • Assuming browsers ignore this header

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes