5

I have a WCF service hosted on the same server as another web app, but on a different port. The web app uses jQuery to perform get/post requests on the WCF service, and after configuring the WCF service to allow cross origin requests it works fine and as expected.

One issue is having an issue where sometimes (not always), the requests don't work and after looking at the Chrome dev console the WCF service is throwing the below:g

XMLHttpRequest cannot load {url}. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '{origin}' is therefore not allowed access. The response had HTTP status code 403.

I can't replicate this at all, and he's using Google Chrome just like other users are. Could it be his machine?

Chris
  • 7,415
  • 21
  • 98
  • 190
  • 1
    I'm having this same issue right now. It's working for everyone EXCEPT ONE USER. Did you ever figure this out? – Bob Horn Jun 05 '20 at 22:31
  • Did you find an answer? I am experiencing this behaviour in an Mongo - Node - Angular WebApp. After some time it looks as if one user gets corrupted and cannot be repaired. All other users that are registered work just fine. – Andreiasw Jul 24 '20 at 10:12
  • same for me .. i sent a pre-flight request using CURL and it works perfectly fine,,.. only for one user it fails – Arun Sep 11 '20 at 20:52
  • Were you guys even able to resolve this issue? If yes, how did you do it? – Vikram Deshmukh Mar 18 '21 at 05:27
  • what was the solution ? did you ever find out the root cause ? – Code_Like_a_Newbie Feb 13 '23 at 06:46

1 Answers1

-1

you have to add headers at server side like

Access-Control-Allow-Origin: *

Check this link:https://security.stackexchange.com/questions/43639/why-is-the-access-control-allow-origin-header-necessary

Community
  • 1
  • 1
Arun
  • 1,177
  • 9
  • 15
  • Yep they are there already - for most users it's working fine, it's only this 1 user with the issue. – Chris Oct 07 '15 at 12:23
  • from client side were you appending any headers. – Arun Oct 07 '15 at 12:26
  • you checked this link http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work – Arun Oct 07 '15 at 12:27