I am not allowed to upvote or comment yet, but I found Rob's solution works great for Cross-Origin Resource Sharing.