Skip to content

Instantly share code, notes, and snippets.

@ianlevesque
Last active May 16, 2016 23:46
Show Gist options
  • Save ianlevesque/4cf8327351e0e6decd49070adefd88c6 to your computer and use it in GitHub Desktop.
Save ianlevesque/4cf8327351e0e6decd49070adefd88c6 to your computer and use it in GitHub Desktop.
Icecast patch to add CORS header
diff -Naur icecast-kh-icecast-2.3.3-kh10/src/format.c icecast-kh-icecast-2.3.3-kh10-patched/src/format.c
--- icecast-kh-icecast-2.3.3-kh10/src/format.c 2014-02-17 20:46:17.000000000 -0500
+++ icecast-kh-icecast-2.3.3-kh10-patched/src/format.c 2016-05-16 11:33:58.000000000 -0400
@@ -433,6 +433,10 @@
"Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n");
remaining -= bytes;
ptr += bytes;
+
+ bytes = snprintf (ptr, remaining, "Access-Control-Allow-Origin: *\r\n");
+ remaining -= bytes;
+ ptr += bytes;
bytes = snprintf (ptr, remaining, "\r\n");
remaining -= bytes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment