lm-commons / lmccors Goto Github PK
View Code? Open in Web Editor NEWLmcCors is a simple Laminas MVC module that helps you to deal with Cross-Origin Resource Sharing (CORS).
Home Page: https://lm-commons.github.io/LmcCors/
License: MIT License
LmcCors is a simple Laminas MVC module that helps you to deal with Cross-Origin Resource Sharing (CORS).
Home Page: https://lm-commons.github.io/LmcCors/
License: MIT License
Move documentation from github.io.doc to /docs folder
Add Docusaurus package to /docs
Add GH Actions to publish site to lm-commons.github.io/LmcCors
Add Renovate dependency support
Hi,
I made the following settings:
Copy lmc_cors.global to /config/autoload/lmc_cors.local.php
In /config/modules.config.php
return [ 'Laminas\Session', 'Laminas\Db', 'Laminas\I18n', 'Laminas\Filter', 'Laminas\Hydrator', 'Laminas\Mvc\Console', 'Laminas\Router', 'Laminas\Validator', 'Laminas\DeveloperTools', 'Laminas\Cache', 'LmcCors', 'Application',
In my modules.config.php /module/Login/Module.php
`<?php
/**
declare(strict_types=1);
namespace Login;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
use Laminas\ServiceManager\Factory\InvokableFactory;
use LmcCors;
return [
'lmc_cors' => [
'allowed_origins' => ['*'],
'allowed_methods' => ['GET', 'POST', 'DELETE'],
],
'router' => [
'routes' => [
'login' => [
'type' => Segment::class,
'options' => [
'route' => '/login[/:action]',
'defaults' => [
'controller' => Controller\LoginController::class,
'action' => 'index',
\LmcCors\Options\CorsOptions::ROUTE_PARAM => [
'allowed_methods' => ['POST'],
],
],
],
],
],
],
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
'strategies' => [
'ViewJsonStrategy',
],
],
];
`
Even so, I still receive the message that CORS is not enabled
URL de Solicitação: http://www.apivf.local/login/login Política de referenciador: strict-origin-when-cross-origin Cabeçalhos provisórios são mostrados Accept: application/json, text/plain, */* Content-Type: application/json Referer: http://www.appvf.local/ User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.57
URL de Solicitação: http://www.apivf.local/login/login Método de Solicitação: OPTIONS Código de Status: 200 OK Endereço Remoto: 127.0.0.1:80 Política de referenciador: strict-origin-when-cross-origin Access-Control-Allow-Headers: Authorization Access-Control-Allow-Methods: POST Access-Control-Allow-Origin: http://www.appvf.local Access-Control-Max-Age: 0 Connection: Keep-Alive Content-Length: 0 Content-Type: text/html; charset=UTF-8 Date: Thu, 25 Mar 2021 02:48:15 GMT Keep-Alive: timeout=5, max=100 Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.4.15 X-Powered-By: PHP/7.4.15 Accept: */* Accept-Encoding: gzip, deflate Accept-Language: pt-BR,pt;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6 Access-Control-Request-Headers: content-type Access-Control-Request-Method: POST Cache-Control: no-cache Connection: keep-alive Host: www.apivf.local Origin: http://www.appvf.local Pragma: no-cache Referer: http://www.appvf.local/ Sec-Fetch-Mode: cors User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.57
Can you help me with any tips, or something I'm doing wrong?
Thank you very much
Review code to support PHP8
PSR-1 is deprecated.
Upgrade to PSR-4.
Move CI to use GitHub actions instead of Travis
Update dependencies to add PHP 8.2
Update test cases
Add a ConfigProvider class
Add parameter typing
Add function return types
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@docusaurus/core
, @docusaurus/module-type-aliases
, @docusaurus/preset-classic
, @docusaurus/types
)react
, react-dom
)composer.json
php ^8.1 | ^8.2
laminas/laminas-eventmanager ^2.6.4 || ^3.2.1
laminas/laminas-http ^2.10
laminas/laminas-mvc ^2.7.15 || ^3.1.1
laminas/laminas-servicemanager ^2.7.9 || ^3.4.0
laminas/laminas-i18n ^2.9
laminas/laminas-log ^2.10
laminas/laminas-modulemanager ^2.7.2
laminas/laminas-serializer ^2.8
laminas/laminas-view ^2.8.1
phpunit/phpunit ^9.5.0
php-coveralls/php-coveralls ^2.1
squizlabs/php_codesniffer ^3.4
laminas/laminas-component-installer ^3.4
.github/workflows/build-test.yml
shivammathur/setup-php v2
actions/checkout v4
actions/cache v4
.github/workflows/deploy-gh-pages.yml
actions/checkout v4
actions/setup-node v4
peaceiris/actions-gh-pages v4
.github/workflows/test-deploy-gh-pages.yml
actions/checkout v4
actions/setup-node v4
docs/package.json
@docusaurus/core 3.2.1
@docusaurus/preset-classic 3.2.1
@mdx-js/react ^3.0.0
clsx ^2.0.0
prism-react-renderer ^2.3.0
react ^18.0.0
react-dom ^18.0.0
@docusaurus/module-type-aliases 3.2.1
@docusaurus/types 3.2.1
node >=18.0
in docs/docs/03-guide.md
, line 27, replace ZfcCors by LmcCors
There are test cases that use deprecated functions that will be removed in phpunit 10.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.