Bird
0
0

Given this CORS configuration snippet for an S3 bucket:

medium📝 Predict Output Q13 of 15
AWS - API Gateway
Given this CORS configuration snippet for an S3 bucket:
{
  "CORSRules": [
    {
      "AllowedOrigins": ["https://example.com"],
      "AllowedMethods": ["GET"],
      "AllowedHeaders": ["*"],
      "MaxAgeSeconds": 3000
    }
  ]
}
What will happen if a browser from https://example.com sends a POST request to this bucket?
AThe POST request will succeed because MaxAgeSeconds is set.
BThe POST request will succeed because AllowedHeaders is '*'.
CThe POST request will be redirected to GET automatically.
DThe POST request will be blocked due to method not allowed.
Step-by-Step Solution
Solution:
  1. Step 1: Check AllowedMethods in CORS configuration

    Only GET method is allowed from https://example.com.
  2. Step 2: Understand effect on POST request

    POST is not in AllowedMethods, so the browser will block the request due to CORS policy.
  3. Final Answer:

    The POST request will be blocked due to method not allowed. -> Option D
  4. Quick Check:

    AllowedMethods=GET only, POST blocked [OK]
Quick Trick: AllowedMethods must include the request method [OK]
Common Mistakes:
MISTAKES
  • Confusing AllowedHeaders with AllowedMethods
  • Thinking MaxAgeSeconds affects allowed methods
  • Assuming POST auto-converts to GET

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes