Fix CORS problem in express-js with Firefox

已完成 已发布的 Nov 28, 2012 货到付款
已完成 货到付款

I have created two simple web sites in express-js. The Ankara site provides an API and other sites can use that API by including the [url removed, login to view] file. The API allows the client site (Belize is an example) to post data back to Ankara for treatment. The attached samples are working fine in Internet Explorer and Google Chrome but not in Firefox and I need someone to fix that.

To test is very simple, just open two node.js windows and execute each web site. You will have Ankara listening on port 3080 and Belize in port 3090. If you then navigate locally to http://localhost:3080 you will visit Ankara directly and the page allows you to test the exchange, with a window showing "next" at each step. For some reasons the sessions in express are not working so you have to kill the Ankara node process to continue testing.

Then, if you have again both sites running, you navigate to http://localhost:3090 you will visit the Belize site and again, you'll be able to start the exchange, see next at each step and you have to kill Ankara again to stop.

This works perfectly fine in IE 9, Chrome 23 but in Firefox 17 is only working locally when the page is displayed in the Ankara site (http://localhost:3080). When loaded from Belize, the first POST is sent to Ankara with the OPTIONS preflight, the server answers back with data but Firefox does not use that data. I am not sure if I am missing something in jQuery for Firefox to work.

You can download the files and test before bidding to be on the safe side. For somebody who knows what is the problem is might be very easy but I hadn't been able to figure out why it does not work in Firefox. Of course, your correction has to keep the projects in node, changes to the strictly minimum required and clearly documented what needs to be changed. And has to still work in IE9 and Chrome.

jQuery / Prototype Node.js

项目ID: #3992806

关于项目

2个方案 远程项目 活跃的Nov 28, 2012

授予:

RedGreenRefactor

G'day, I have run the sites locally and debugged ankara.js. The patch is tested and working in chrome, firefox, safari, and ie.

$35 USD 在1天内
(2条评论)
2.0

有2名威客正在参与此工作的竞标,均价$43/小时

WEBgeneUK

Hello Sir, I'm an JS expert, I did checked your files and I do have ready solution. Best Regards, Genie

$50USD 在1天里
(8条评论)
4.2