Complete the code to import the Flask-CORS extension.
from flask_cors import [1]
The Flask-CORS extension is imported using CORS.
Complete the code to initialize Flask-CORS for the Flask app.
app = Flask(__name__)
[1](app)To enable CORS on the Flask app, you call CORS(app).
Fix the error in the code to allow CORS only for the origin 'http://example.com'.
CORS(app, resources={r"/*": {"origins": [1])The origins value must be a list or string. To allow only 'http://example.com', use a list with that string.
Fill both blanks to configure CORS to allow only GET and POST methods from any origin.
CORS(app, resources={r"/*": {"origins": [1], "methods": [2])Use '*' to allow any origin and a list ['GET', 'POST'] to specify allowed methods.
Fill all three blanks to configure CORS with Flask app to allow origins 'http://site1.com' and 'http://site2.com', allow credentials, and only allow PUT method.
CORS(app, resources={r"/*": {"origins": [1], "supports_credentials": [2], "methods": [3])Origins must be a list of allowed URLs, supports_credentials is a boolean to allow cookies, and methods is a list of allowed HTTP methods.