pagemachine/cors 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pagemachine/cors

最新稳定版本:2.0.6

Composer 安装命令:

composer require pagemachine/cors

包简介

Cross Origin Resource Sharing for TYPO3 CMS.

关键字:

README 文档

README

Cross Origin Resource Sharing for TYPO3

Installation

This extension is installable from various sources:

  1. Via Composer:

     composer require pagemachine/cors
    
  2. From the TYPO3 Extension Repository

  3. From Github

Configuration

All configuration options can be set via TypoScript setup in config.cors or per page object in page.config.cors. The following options are available:

Option Type Description
allowCredentials int/boolean Processing of the credentials flag
allowHeaders string List of allowed headers (X-Foo, ...), simple headers are always allowed
allowMethods string List of allowed methods (PUT, DELETE, ...), simple methods are always allowed
allowOrigin string List of allowed origins
allowOrigin.pattern string Regular expression for matching origins, make sure to escape as necessary
exposeHeaders string List of headers exposed to clients
maxAge int Cache lifetime of preflight requests, watch out for browser limits

Note that all options support stdWrap processing through their .stdWrap property.

Examples

  • Origin wildcarding:

      config.cors {
        allowOrigin = *
      }
    
  • Simple list of origins:

      config.cors {
        allowOrigin = http://example.org, http://example.com
        // More readable version
        allowOrigin (
          http://example.org,
          http://example.com
        )
      }
    
  • Matching origins via regular expressions:

      config.cors {
        allowOrigin.pattern = https?://example\.(org|com)
      }
    
  • Allow specific methods:

      config.cors {
        allowMethods = GET, POST, PUT, DELETE
      }
    
  • Allow headers:

      config.cors {
        allowHeaders = (
          Content-Type,
          ...
        )
      }
    
  • Allow credential flag processing:

      config.cors {
        // Set to 1/true to enable
        allowCredentials = 1
      }
    
  • Expose headers:

     config.cors {
       exposeHeaders (
         X-My-Custom-Header,
         X-Another-Custom-Header
       )
     }
    
  • Set maximum age of preflight request result:

      config.cors {
        // 10 minutes
        maxAge = 600
      }
    
  • Set maximum age via some stdWrap processing:

      config.cors {
        maxAge.stdWrap.cObject = TEXT
        maxAge.stdWrap.cObject {
          value = 600
        }
      }
    

Issues

Found a bug? Need a feature? Let us know through our issue tracker.

Testing

All tests can be executed with the shipped Docker Compose definition:

docker-compose run --rm app composer build

统计信息

  • 总下载量: 3.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2014-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固