include::../description.adoc[]

include::../ask-yourself.adoc[]

include::../recommended.adoc[]

== Sensitive Code Example

----
header("Access-Control-Allow-Origin: *"); // Sensitive
----

Laravel

----
response()->header('Access-Control-Allow-Origin', "*"); // Sensitive
----

Symfony

----
use Symfony\Component\HttpFoundation\Response;

$response = new Response(
    'Content',
    Response::HTTP_OK,
    ['Access-Control-Allow-Origin' => '*'] // Sensitive
);
$response->headers->set('Access-Control-Allow-Origin', '*'); // Sensitive
----

== Compliant Solution

----
header("Access-Control-Allow-Origin: $trusteddomain"); // Compliant
----

Laravel

----
response()->header('Access-Control-Allow-Origin', $trusteddomain); /// Compliant
----

Symfony

----
use Symfony\Component\HttpFoundation\Response;

$response = new Response(
    'Content',
    Response::HTTP_OK,
    ['Access-Control-Allow-Origin' => $trusteddomain] /// Compliant

$response->headers->set('Access-Control-Allow-Origin',$trusteddomain); // Compliant
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
