fruitcake

fruitcake

Member Since 7 years ago

Netherlands

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
30
repos
Activity
Oct
15
1 day ago
Activity icon
issue

barryvdh issue comment fruitcake/laravel-cors

barryvdh
barryvdh

Yeah wel nothing actually changed except the matrix? Not sure if you need a tag?

Activity icon
issue

driesvints issue comment fruitcake/laravel-cors

driesvints
driesvints

Cool, let me know when you tagged that and we can bump the dependency in the Laravel skeleton 👍

Activity icon
delete

barryvdh in fruitcake/laravel-cors delete branch feat-php8.1

deleted time in 14 hours ago
push

barryvdh push fruitcake/laravel-cors

barryvdh
barryvdh

Test PHP8.1 (#544)

  • Test PHP8.1

  • Test php8.1 on L8

commit sha: d82f2eba327b1d728a2014ee5cd365ad08cfed63

push time in 14 hours ago
Activity icon
issue

driesvints issue comment fruitcake/laravel-cors

driesvints
driesvints

@barryvdh we can bump php-webdriver now to 1.12.0 which got released yesterday.

started
started time in 16 hours ago
started
started time in 18 hours ago
Activity icon
fork

kldgleb forked fruitcake/laravel-cors

⚡ Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
kldgleb MIT License Updated
fork time in 18 hours ago
Oct
14
2 days ago
Oct
12
4 days ago
Activity icon
fork

laravel-request forked fruitcake/laravel-cors

⚡ Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
laravel-request MIT License Updated
fork time in 3 days ago
Activity icon
issue

Favorlock issue comment fruitcake/laravel-telescope-toolbar

Favorlock
Favorlock

Introduce the ability to include requests for paths.

I was experiencing an issue where some of my requests didn't have profiles I could load, so I decided to introduce a config setting for including paths.

I'm unsure if there is a more preferable way this could have been implemented, but it does work for my situation and I think it'd be a good addition to this tool.

Favorlock
Favorlock

Any chance this will be implemented?

Oct
11
5 days ago
started
started time in 4 days ago
Oct
10
6 days ago
Oct
9
1 week ago
pull request

chapeupreto pull request fruitcake/laravel-cors

chapeupreto
chapeupreto

chore: add `.editorconfig` file

This commit adds .editorconfig file.

For more information, please check https://editorconfig.org/

Activity icon
fork

chapeupreto forked fruitcake/laravel-cors

⚡ Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
chapeupreto MIT License Updated
fork time in 6 days ago
Activity icon
issue

Stecken issue comment fruitcake/laravel-cors

Stecken
Stecken

No 'Access-Control-Allow-Origin' header is present on the requested resource.

im using this boilerplate Apiato

postman request working and browser request working but axios request not working.

axios setup.

import axios from 'axios';

const api = axios.create({
    baseURL: 'http://api.apiato.test/v1',
    headers: {
        'Access-Control-Allow-Origin': '*',
        'Content-type': 'application/json',
    },
});

api.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

let token = document.head.querySelector('meta[name="csrf-token"]') as HTMLMetaElement;

if (token) {
    api.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

export default api;

error.

Access to XMLHttpRequest at 'http://api.apiato.test/v1/users' from origin 'http://apiato.test' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

app.js:1691 Uncaught (in promise) Error: Network Error
    at createError (app.js:1691)
    at XMLHttpRequest.handleError
Stecken
Stecken

hello guyz i found the solution. my configuration is exactly as the documentation says. but the problem was with the app cache.

so i cleared cache

and it worked

command

php artisan config:clear

For me it worked creating the middlewares and clearing the cache, thank you!

Oct
8
1 week ago
Activity icon
fork

davaeiha forked fruitcake/laravel-cors

⚡ Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
davaeiha MIT License Updated
fork time in 1 week ago
Activity icon
fork

ovillafuerte94 forked fruitcake/laravel-cors

⚡ Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
ovillafuerte94 MIT License Updated
fork time in 1 week ago
Oct
7
1 week ago
Activity icon
issue

william-lohan issue comment fruitcake/laravel-cors

william-lohan
william-lohan

Laravel 8 Cors not working

Hi I have done all the "before you start tasks and checks" Error in cosole log:

Access to fetch at 'http://127.0.0.1:8000/register' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Network Request: image

\config\cors.php

return [

    'paths' => ['api/*', 'register', 'oauth/*'],
    'allowed_methods' => ['OPTIONS,POST,PUT,DELETE,GET'],
    'allowed_origins' => ['*'],
    'allowed_origins_patterns' => [],
    'allowed_headers' => ['*'],
    'exposed_headers' => ['*'],
    'max_age' => 0,
    'supports_credentials' => true,
];

Kernel.php

 protected $middleware = [

       \Fruitcake\Cors\HandleCors::class,

I have tried as many combinations of the above as I can spent about 6 hours on it now with no success, your help would be greatly appreciated.

thanks

Dan

william-lohan
william-lohan

In my case, under allowed_origins localhost:8080 and http://localhost:8080/ didn't work but http://localhost:8080 did (notice lack of slash)

started
started time in 1 week ago
Oct
6
1 week ago
started
started time in 1 week ago
Oct
5
1 week ago
started
started time in 1 week ago
Activity icon
issue

linehammer issue comment fruitcake/laravel-cors

linehammer
linehammer

Cross-Origin Request Blocked

Hi

I tried all the way but its blocking. I am using a laravel 7.2 version. And my front end is react. I tested this with fetch and axios but it is not working.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost/smarttalkonlineedu/webapps/api/public/api/loginin. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

linehammer
linehammer

The Same Origin Policy (SOP) is a security measure standardized among browsers. It is needed to prevent Cross-Site Request Forgery (CSRF). The "Origin" mostly refers to a "Domain". Same Origin Policy prevents different origins (domains) from interacting with each other, to prevent attacks such as CSRF (Cross Site Request Forgery) through such requests, like AJAX. In other words, the browser would not allow any site to make a request to any other site. Without Same Origin Policy , any web page would be able to access the DOM of other pages.

This SOP (Same Origin Policy) exists because it is too easy to inject a link to a javascript file that is on a different domain. This is actually a security risk ; you really only want code that comes from the site you are on to execute and not just any code that is out there.

If you want to bypass that restriction when fetching the contents with fetch API or XMLHttpRequest in javascript, you can use a proxy server so that it sets the header Access-Control-Allow-Origin to *.

If you need to enable CORS on the server in case of localhost, you need to have the following on request header.

Access-Control-Allow-Origin: http://localhost:9999

Oct
4
1 week ago
started
started time in 1 week ago
Activity icon
issue

peterpan666 issue fruitcake/laravel-cors

peterpan666
peterpan666

Specify domain for paths

Hi,

Is there anyway to configure the paths separately ?

What I would like is something like this :

  • api1/* => Allows sub1.example.com
  • api2/* => Allows sub2.example.com

Anyway to achieve this using this package ?

Previous