Skip to content

Commit 415903f

Browse files
Ziyi Haofacebook-github-bot
Ziyi Hao
authored andcommitted
Add back CORS headers
Summary: this seems accidently removed in this diff: D69179107 adding it back Reviewed By: jai1623 Differential Revision: D70746795 fbshipit-source-id: 3c80115f679c8286620e40775e9436bf7efee0b4
1 parent a2f0389 commit 415903f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

facebook-for-wordpress.php

+6
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ public function handle_events_request() {
125125
$data
126126
);
127127
}
128+
if ( isset( $_SERVER['HTTP_ORIGIN'] ) ) {
129+
$origin = wp_kses( wp_unslash( $_SERVER['HTTP_ORIGIN'] ), array() );
130+
header( "Access-Control-Allow-Origin: $origin" );
131+
header( 'Access-Control-Allow-Credentials: true' );
132+
header( 'Access-Control-Max-Age: 86400' );
133+
}
128134
exit();
129135
}
130136
}

0 commit comments

Comments
 (0)