Search code examples
ropencpu

OpenCPU fail on mobil devices


I have recently begun toying with OpenCPU and I must admit I am very impressed with it. Though, I have run into a strange problem.

When I try to access an application that I am currently working on, on my laptop, everything is fine. But when I do it on a mobile device, I get an error.

"Connection to OpenCPU failed: error"

Any thoughts on why the error is occurring? I have uploaded an example to www.ttbjerring.com

Best, Bjerring


Solution

  • Some debugging and google reveals that there are multiple problems with the CORS implementation in older versions of Safari. The main issue seems to be that the client can not read the Location header:

    All of this has been fixed in more recent versions of Safari. Do note that Safari for windows is no longer supported by Apple. The latest Windows version (Safari 5) was released in June 2010, with a final patch release 5.1.7 in May 2012. So it has not been updated for over two years.

    Now Safari Mobile is more problematic of course. I don't have an iphone/ipad myself, but it would be helpful to further narrow this down. Which version of Safari/IOS are you using? Did you get a chance to test this on a more recent versions of Safari Mobile? It would be nice to have a workaround, but it might not be easy.

    I did push and deploy a small fix for another problem that Safari seemed to be having in some cases, but I doubt this will solve any of your problems.