adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
173 stars 74 forks source link

Add configurable origin to enable fine-grained CORS support #97

Closed eabadjiev closed 7 years ago

eabadjiev commented 7 years ago

Why

In case allowing all origins (*) is not acceptable the browser needs to send Origin header with a configured URL.

How it works

The default behavior is not changed. When the originUrlString property is set, the library will put all scripts in the HTML and load it from the origin url as specified.

Tests

The signalR server used in the demo doesn't work for me. I used a local server to verify the changes for iOS.

adamhartford commented 7 years ago

Thanks very much for submitting this pull request. I'll test it out and try to get it merged ASAP.

adamhartford commented 7 years ago

This change is in version 0.14.0, now available on CocoaPods. Thanks again! 👍