Closed eshaz closed 8 months ago
Assuming the issue is just relating to a redirect then the headers can be expanded to include those status codes eg
params.c lines 517+ { .hdr = { .status = "2", .name = "Access-Control-Allow-Origin", .value = "", .callback = _send_cors_hdr } }, { .hdr = { .status = "2", .name = "Access-Control-Allow-Credentials", .value = "True", .callback = _send_cors_hdr } }, { .hdr = { .status = "2", .name = "Access-Control-Allow-Headers", .value = "Origin, Icy-MetaData, Range", .callback = _send_cors_hdr } }, { .hdr = { .status = "2", .name = "Access-Control-Expose-Headers", .value = "Icy-Br, Icy-Description, Icy-Genre, Icy-MetaInt, Icy-Name, Icy-Pub, Icy-Url", .callback = _send_cors_hdr } }, { .hdr = { .status = "2", .name = "Access-Control-Allow-Methods", .value = "GET, OPTIONS, SOURCE, PUT, HEAD, STATS", .callback = _send_cors_hdr } },
change those "2" to "[23]
karl
That suggestion worked great, and I've updated the PR. Thanks!
This is now in master
karl
This PR is to fix an issue where CORS headers, and possibly other user configured headers, are not being sent on the HTTP response for redirects triggered from the below section. It looks like there was some recent additions to work around iOS quirks that are using this flow, so the issue is apparent only in iOS.
https://github.com/karlheyes/icecast-kh/blob/a8cfaae2bde027f714b8d1099c5adb88f4bed922/src/format.c#L381-L392
The line removed in these changes appears to be improperly filtering out the CORS headers from the response, causing the cross-origin redirect to fail in iOS. See eshaz/icecast-metadata-js#186