An HTTP Cloud Function receives metrics from a separate application web origin. Which Access-Control-Allow-Origin header value allows only that application to post metrics?
Choose an answer
Tap an option to check your answer.
Correct answer: Access-Control-Allow-Origin: the exact application web origin.
Why this is the answer
The Access-Control-Allow-Origin header specifies which origins are permitted to access the resource. To allow only a specific application to post metrics, you must set this header to the exact origin of that application. This ensures that only requests originating from that precise domain are allowed, preventing Cross-Origin Resource Sharing (CORS) errors for legitimate requests while blocking unauthorized ones. Setting Access-Control-Allow-Origin: would allow any origin to access the Cloud Function, which is insecure and defeats the purpose of restricting access. Using a wildcard for all application subdomains would be too broad if the goal is to restrict to a single, specific application. The Cloud Function's own origin is irrelevant here, as the request is coming from the separate application to the Cloud Function.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed