Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on cors wildcard #22

Open
ShintaroNippon opened this issue Apr 26, 2018 · 5 comments
Open

Error on cors wildcard #22

ShintaroNippon opened this issue Apr 26, 2018 · 5 comments
Labels

Comments

@ShintaroNippon
Copy link

Hello,
im using laravel in backend but im getting this issus when upload images...

Failed to load http://laravel.local.pt/api/v1/register/savemultipleimages: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access.
portefolio.js:69 TypeError: Failed to fetch

the code of laravel is


 /* register a IMAGE */
  Route::post('/register/savemultipleimages',[
    'uses' => 'RegisterProController@saveMultipleImages',
  ]);


 public function saveMultipleImages(Request $request){
      
      return Response::json([
      ], 200);
    }

Can someone help me on this ?

Thanks in advance.
Carlos Vieira

@ShintaroNippon ShintaroNippon changed the title Error on cors wildacard Error on cors wildcard Apr 26, 2018
@kirillDanshin
Copy link
Collaborator

Please google for fetch docs. You must allow exactly that domain, not the '*'.

Not a lib issue, so marking as a question.

@ShintaroNippon
Copy link
Author

Many thanks i will try

@ShintaroNippon
Copy link
Author

HI there how can i solve this ?
because i need the wild card in cross origin ?
is there another way ?

thanks carlos vieira

@ShintaroNippon
Copy link
Author

For now for testing i have this.. in webpack

devServer: {
contentBase: appPath,
publicPath: '/',
historyApiFallback: true,
inline: true,
port: devPort,
hot: true,
headers: {
"Access-Control-Allow-Origin": "http://localhost:8080",
"Access-Control-Allow-Credentials" : "true"
},
compress: true,
disableHostCheck: true
},

but i'm getting an error

The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access.

can someone help ...
thanks
Carlos Vieira

@ShintaroNippon
Copy link
Author

i got it it was one problem in server side
all solved..
many thanks
just another question i can i show the preview images after loadin...
because de images preview disappears

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants