Comments (14)
I don't know what is wrong, but in line 1822 the script does call:
header('Access-Control-Allow-Origin: *');
Can you try to be more specific? What call is failing? Is there a pre-flight request failing?
from php-crud-api.
Did you see the angular2 client example in the "examples" folder? Does that work for you?
from php-crud-api.
Good idea to first check how CORS behave with the angular2 example. When I run the api with sqlite, I get:
EXCEPTION: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
from php-crud-api.
Use a tool like postman (https://www.getpostman.com/) to check the output of the API. Maybe you are missing a dependency and is it showing an error. Also try F12 and use "developer tools" to debug the requests made using the "Net" tab.
from php-crud-api.
The CORS issue is resolved when I comment out line 1822
header('Access-Control-Allow-Origin: *');
Uncommenting returns the CORS warning.
from php-crud-api.
Can you provide more details as this is opposite to what I expect (and experience). How can I reproduce the CORS warning?
For the SQLite problem I created another issue (#57).
from php-crud-api.
I need to know more things, like:
- operating system
- php version
- mysql version
- url requested
- response headers
- response body
from php-crud-api.
Closed due to inactivity.
from php-crud-api.
Maurits
Ik heb geen tijd gehad om dit te bekijken voor jou. Wat ik vermoed: mijn domein aanvaardt via htaccess (tijdelijk ;) ) * hosts. Misschien dat de extra header call vanuit het crud php script conflicteert?
====[translated by mevdschee]====
I had no time to look at this for you. I suspect that my domain (temporarily ;-) ) accepts * hosts via htaccess. Maybe that the extra call from the crud php script is conflicting with that?
Groeten
Frederik
On 14 apr. 2016, at 13:34, Maurits van der Schee [email protected] wrote:
Can you provide more details as this is opposite to what I expect (and experience). How can I reproduce the CORS warning?
For the SQLite problem I created another issue.
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #55 (comment)
from php-crud-api.
Hi Frederik,
That could very well be the problem. Maybe you can try disabling that in the htaccess and see what happens? It is possibly an environment issue.
Kind regards,
Maurits
from php-crud-api.
Maurits, commenting out the Header add Access-Control-Allow-Origin "*"
line in htaccess solved it!
from php-crud-api.
Great.. thank you, can you also retry #57?
from php-crud-api.
About the new CORS feature..., I am assuming the "*" means ALL origins are allowed? Also would like to know the format for supporting multiple origins... do we place with in a list separated by commas? example: http://website-one.com, https://website-two.com
from php-crud-api.
@pottertech Yes that should work. See: c467f98
from php-crud-api.
Related Issues (20)
- HTML Middleware HOT 2
- Update with "where" HOT 8
- "Request Tranformer" middleware HOT 2
- Azure App Service HOT 1
- Add PHP backend to any app project with one command HOT 1
- Any advice on events integration? HOT 2
- Synchronization between local IndexedDB and MySQL Database. HOT 3
- Can the API Support Customized Cache Management for Specific Tables? HOT 9
- Question: Add property on create HOT 3
- Insights on caching with Redis HOT 2
- Using Customization handler to insert app-generated ID HOT 11
- PUT using curl comes back successful but the record is not actually updated HOT 2
- Suggestion to modify response JSON root Key (records) HOT 2
- firebase jwt public key rotation HOT 5
- "Route '' not found" HOT 3
- Additional SQL queries in authorization handlers HOT 2
- Direct usage of PHP CRUD API functions in external PHP Files HOT 8
- Failure on postgres when table name is domains HOT 10
- Returning user uploaded file using custom controller HOT 2
- Found this PDOException occurred (enable debug mode) in message HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crud-api.