flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.6k stars 407 forks source link

Request with header "Access-Control-Request-Header" and "Access-Control-Request-Method" not found (404) #364

Closed superdit closed 5 months ago

superdit commented 6 years ago

Hello, I'm using flightphp for webservice with ionic as mobile app, I'm sending additional header parameter for authentification, adding Access-Control-Request-Header and Access-Control-Request-Method

here are ionic code `searchPackageHome() {

return new Promise((resolve, reject) =>{

  let h = new HttpHeaders({
    merchant_id: '105',
    merchant_user_id: '90'
  });

  let tmpUrl = "http://localhost:7070/um/api/search?location=0&package=0&date=&fee=0";
  this.http.get(tmpUrl, {headers: h}).timeout(5000).subscribe(data => {
    resolve(data);
  }, (err) => {
    resolve("error package");
  });

});

}`

here are the http header looks on browser

image

flight routing not found, I have try these flight routing but still have no luck $app->route('GET|POST|PUT|DELETE /search', function() {}); $app->route('/search', function() {});

i get "404 Not Found The page you have requested could not be found."

but without Access-Control-Request-Header and Access-Control-Request-Method the routing is working fine

please help....

n0nag0n commented 5 months ago

Do you still have or care about this issue? Reopen if you do.