Giter Site home page Giter Site logo

hydra's Introduction

Hydra. So many Head(er)s.

This extension allows to add response headers on a per site base without using TypoScript.

If you have only one set of response headers that you want your TYPO3 websites to send, it might be a good idea to configure the headers directly in your webserver. However, there might be the requirement that different sites inside the same TYPO3 system have to send different headers. In such a case, this extension provides the functionality to configure response headers in the site configuration.

Example

In the site config simply specify the headers:

responseHeaders:
  Content-Security-Policy: "default-src 'self';"
  Referrer-Policy: "no-referrer-when-downgrade"
  X-Content-Type-Options: "nosniff"
  X-Xss-Protection: "1; mode=block"
  Feature-Policy: "camera 'none'; geolocation 'none'; microphone 'none'; payment 'none'"
  Permissions-Policy: "camera=(), geolocation=(), microphone=(), payment=()"
  X-Frame-Options: "SAMEORIGIN"

To improve maintainability of header configuration with many parts like CSP or Feature-policy each header can be configured as a list. The list items will be concatenated to one string when the header is added. The above example could be rewritten like this:

responseHeaders:
  Content-Security-Policy: "default-src 'self';"
  Referrer-Policy: "no-referrer-when-downgrade"
  X-Content-Type-Options: "nosniff"
  X-Xss-Protection: "1; mode=block"
  Feature-Policy:
    - "camera 'none';"
    - "geolocation 'none';"
    - "microphone 'none';"
    - "payment 'none'"
  Permissions-Policy:
    - "camera=(),"
    - "geolocation=(),"
    - "microphone=(),"
    - "payment=()"
  X-Frame-Options: "SAMEORIGIN"

Those headers will be added via a middleware to responses only for the corresponding site.

Sharing our expertise

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

hydra's People

Contributors

ervaude avatar bmack avatar davidsteeb avatar

Stargazers

Sebastian Iffland avatar Dennis Geldmacher avatar

Watchers

 avatar Achim Fritz avatar  avatar  avatar Oliver Bartsch avatar  avatar Matthias Stegmann avatar  avatar

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.