All Projects → resultsystems → laravel-cors

resultsystems / laravel-cors

Licence: other
Laravel cors

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-cors

Browser Preview
🎢Preview html file in your default browser
Stars: ✭ 148 (+678.95%)
Mutual labels:  cors
Xrcross
XRCross is a Reconstruction, Scanner, and a tool for penetration / BugBounty testing. This tool was built to test (XSS|SSRF|CORS|SSTI|IDOR|RCE|LFI|SQLI) vulnerabilities
Stars: ✭ 175 (+821.05%)
Mutual labels:  cors
Spring Boot Start Current
Spring Boot 脚手架 Mybatis Spring Security JWT 权限 Spring Cache + Redis
Stars: ✭ 246 (+1194.74%)
Mutual labels:  cors
Cors Container
A CORS proxy in a container (Docker) for when you need to `Access-Control-Allow-Origin: *`!
Stars: ✭ 150 (+689.47%)
Mutual labels:  cors
Flusk
Boilerplate API on how to structure big Flask applications (includes SQLAlchemy, Docker, nginx)
Stars: ✭ 165 (+768.42%)
Mutual labels:  cors
Express Es6 Rest Api
🔋 Starter project for an ES6 RESTful Express API.
Stars: ✭ 2,401 (+12536.84%)
Mutual labels:  cors
Egg Cors
CORS plugin for egg
Stars: ✭ 140 (+636.84%)
Mutual labels:  cors
drf-starter-template
DRF Starter Template with drf-yasg, heroku deployment ready config, CORS config
Stars: ✭ 25 (+31.58%)
Mutual labels:  cors
Aiohttp Cors
CORS support for aiohttp
Stars: ✭ 173 (+810.53%)
Mutual labels:  cors
Link Preview Js
Parse and/or extract web links meta information: title, description, images, videos, etc. [via OpenGraph], runs on mobiles and node.
Stars: ✭ 240 (+1163.16%)
Mutual labels:  cors
Rust Webapp Starter
Rust single page webapp written in actix-web with vuejs.
Stars: ✭ 151 (+694.74%)
Mutual labels:  cors
Cloudflare Cors Anywhere
CORS "anywhere" proxy in a Cloudflare worker. DEMO at: https://test.cors.workers.dev/
Stars: ✭ 162 (+752.63%)
Mutual labels:  cors
Koa2 Cors
CORS middleware for koa2
Stars: ✭ 223 (+1073.68%)
Mutual labels:  cors
Cors Vulnerable Lab
Sample vulnerable code and its exploit code
Stars: ✭ 149 (+684.21%)
Mutual labels:  cors
Instagram Proxy Api
CORS compliant API to access Instagram's public data
Stars: ✭ 245 (+1189.47%)
Mutual labels:  cors
Sanic Cors
A Sanic extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. Based on flask-cors by Cory Dolphin.
Stars: ✭ 143 (+652.63%)
Mutual labels:  cors
Web Security Fundamentals
👨‍🏫 Mike's Web Security Course
Stars: ✭ 195 (+926.32%)
Mutual labels:  cors
realestate
A simple real estate app build with MEAN( Angular, Node and mongoDb ) and MERN( React, Node and mongoDb )
Stars: ✭ 33 (+73.68%)
Mutual labels:  cors
Bus
Bus 是一个基础框架、服务套件,它基于Java8编写,参考、借鉴了大量已有框架、组件的设计,可以作为后端服务的开发基础中间件。代码简洁,架构清晰,非常适合学习使用。
Stars: ✭ 253 (+1231.58%)
Mutual labels:  cors
Akka Http Cors
Akka Http directives implementing the CORS specifications defined by W3C
Stars: ✭ 234 (+1131.58%)
Mutual labels:  cors

Laravel Cors

Pacote abandonado pois o Laravel 7.X já tem suporte a cors nativo, use apenas se você tiver usando a versão 6.X ou abaixo.

Instalação

Vídeo Tutorial

1. Dependência

Usando o composer, execute o comando a seguir para instalar automaticamente composer.json:

composer require resultsystems/laravel-cors

2. Middlewares

Para utilizá-los é necessário registrá-los no seu arquivo app/Http/Kernel.php.

 protected $middleware = [
        // other middleware ommited
    	\ResultSystems\Cors\CorsMiddleware::class,
 ];

3. Provider (opcional)

Selecionar os domínios permitidos no Laraver-Cors em sua aplicação Laravel, é necessário registrar o package no seu arquivo config/app.php. Adicione o seguinte código no fim da seção providers

// file START ommited
    'providers' => [
        // other providers ommited
        \ResultSystems\Cors\CorsServiceProvider::class,
    ],
// file END ommited

3.1 Publicando o arquivo de configuração (somente se tiver feito o passo 3)

Para publicar o arquivo de configuração padrão que acompanham o package, execute o seguinte comando:

php artisan vendor:publish  --provider="ResultSystems\Cors\CorsServiceProvider"

4 Configurações (somente se tiver feito o passo 3, e 3.1)

configure o arquivo com os domínios que dejeja liberar

config/cors.php

Inspirado no artigo: http://en.vedovelli.com.br/2015/web-development/Laravel-5-1-enable-CORS/ Obrigado @vedovelli

5 Bônus

Caso você utilize nginx

Adicione estas configurações no arquivo de configurações do site:

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ /$is_args$args;
	     if ($request_method = 'OPTIONS') {
	        add_header 'Access-Control-Allow-Origin' '*';
	        #
	        # Om nom nom cookies
	        #
	        add_header 'Access-Control-Allow-Credentials' 'true';
	        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
	        #
	        # Custom headers and headers various browsers *should* be OK with but aren't
	        #
	        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Authorization,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
	        #
	        # Tell client that this pre-flight info is valid for 20 days
	        #
	        add_header 'Access-Control-Max-Age' 1728000;
	        add_header 'Content-Type' 'text/plain charset=UTF-8';
	        add_header 'Content-Length' 0;
	        return 204;
	     }
	}

Caso seja apache, talvez seja necessário adicionar estas linhas abaixo ao .htaccess

    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews
        </IfModule>
    </IfModule>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].