Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819
  1. "use strict"
  2. Object.defineProperty(exports, "__esModule", { value: true })
  3. const ALLOWED_PERMITTED_POLICIES = new Set(["none", "master-only", "by-content-type", "all"])
  4. function getHeaderValueFromOptions({ permittedPolicies = "none" }) {
  5. if (ALLOWED_PERMITTED_POLICIES.has(permittedPolicies)) {
  6. return permittedPolicies
  7. } else {
  8. throw new Error(`X-Permitted-Cross-Domain-Policies does not support ${JSON.stringify(permittedPolicies)}`)
  9. }
  10. }
  11. function xPermittedCrossDomainPolicies(options = {}) {
  12. const headerValue = getHeaderValueFromOptions(options)
  13. return function xPermittedCrossDomainPoliciesMiddleware(_req, res, next) {
  14. res.setHeader("X-Permitted-Cross-Domain-Policies", headerValue)
  15. next()
  16. }
  17. }
  18. module.exports = xPermittedCrossDomainPolicies
  19. exports.default = xPermittedCrossDomainPolicies