Changes between Version 8 and Version 9 of edelweiss

Show
Ignore:
Author:
ntj (IP: 141.52.65.31)
Timestamp:
08/22/14 15:36:48 (10 years ago)
Comment:

added a section about CORS error

Legend:

Unmodified
Added
Removed
Modified
  • edelweiss

    v8 v9  
    5050Status: Pending (High priority) 
    5151 
     52 
     53=== Useful Tip === 
     54 
     55This is mainly about CORS (Cross Origin Resource Sharing). If you have an ADEI setup at your localhost, and you wrote a javascript to fetch data directly from your localhost ADEI, 99% of the time you will be thrown this error: 
     56 
     57Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1/adei/services/getdata.php?db_server=wtx_060&db_name=HDCP2&db_group=base&window=1364919175-1364919176&db_mask=0,1,2,3,4,5. This can be fixed by moving the resource to the same domain or enabling CORS. 
     58 
     59When you stumbled upon this, firstly, take a deep breath. Then you must know which server you are trying to talk to. In this case, we are trying to getdata from localhost. And ADEI server is basically Apache server. 
     60 
     61what does this tell us? Our localhost server is not allowing any remote access to get resources, which is set by default to prevent malicious attacks. We need to tell our apache server to allow this. 
     62 
     63So. 
     64 
     65Add this line 
     66 
     67 Header set Access-Control-Allow-Origin "*" 
     68 
     69into your .htaccess 
     70 
     71and then run 
     72 
     73apachectl -t 
     74sudo service apache2 reload 
     75a2enmod headers 
     76 
     77after that it should work. Link: http://enable-cors.org/server_apache.html 
     78 
     79 
     80 
    5281= Repository = 
    5382