Giter Site home page Giter Site logo

dot-response-header's Introduction

DotKernel 3 Logo

GitHub issues GitHub forks GitHub stars GitHub license

Packagist Version (including pre-releases) PHP from Packagist

DotKernel 3 Official Documentation Repository

Documentation ( version 1.0 , based on Zend namespace and Zend Expressive )

Roadmap April 2020

TARGET:

NEW APPLICATIONS

  • api-mail ? service to send emails only
  • PINGU queue system, based on Redis + swoole + Mezzio + deployed as a standalone service

Package versioning:

  1. version 1.x related to Zend Framework and Expressive [deprecated]
  2. version 2.x related to Mezzio and Laminas, without modification of the flow. No new functions, only compatibility [deprecated]
  3. version 3.x related to the new Mezzio and Laminas architecture , in preparation for DK3 version 3

Documentation on each package please !!!!

Requirements for V 3:

  • bump require version of PHP to 7.4
  • doctrine 2.7.x ( latest)
  • twig 3.x (latest)
  • update documentation to reflect changes ( readme.md)

How to:

  • create the branch 3.0 from 2.0 !!!
  • make default branch 3.0 ( not master anymore )
  • enjoy

Package list: see the checllist https://github.com/dotkernel/dotkernel/blob/master/checklist-v3-packages.md

dot-response-header's People

Contributors

alexmerlin avatar arhimede avatar marioradu avatar popnatanael avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

popnatanael

dot-response-header's Issues

Fix Readme

  • remove extra Dot from Dot\Dot\ResponseHeader\ConfigProvider::class,
  • provide instruction for adding ResponseHeaderMiddleware to the pipeline
  • (optional) provide a response-header.global.php.dist file and instruct developers on where to copy it
<?php

declare(strict_types=1);

return [
    'dot_response_headers' => [
        /**
         * Global headers - applied to all routes
         */
        '*' => [
            'header-name' => [
                'value' => 'header-value',
                'overwrite' => true,
            ],
        ],

        /**
         * Route-specific headers
         */
        'route-name' => [
            'header-name' => [
                'value' => 'header-value',
                'overwrite' => true,
            ]
        ],
    ]
]
```;

Add Codecov badge

codecov

[![codecov](https://codecov.io/gh/dotkernel/dot-response-header/graph/badge.svg?token=NNRZN0FBF2)](https://codecov.io/gh/dotkernel/dot-response-header)

Existing header incorrect overwrite

If header exists, ResponseHeaderMiddleware:addHeaders tries to add same header with the new value - instead of overwriting it.
The below should be enough:

    $overwrite = (isset($data['overwrite']) && $data['overwrite'] === true) ? true : false;
    if ($overwrite) {
        $response = $response->withHeader($header, $data['value']);
    }

Test config:

    'dot_response_headers' => [
        '*' => [
            'permissions-policy' => [
                'value' => 'interest-cohort=()',
                'overwrite' => true,
            ],
        ],
        'home' => [
            'permissions-policy' => [
                'value' => 'foo'
            ]
        ],
    ]

The value of permissions-policy should stay interest-cohort=()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.