承接 epilgrim/modify-request-headers-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

epilgrim/modify-request-headers-bundle

Composer 安装命令:

composer require epilgrim/modify-request-headers-bundle

包简介

Symfony bundle to inject request headers

README 文档

README

This bundle allows to add arbitrary request headers to the Request object.

The use case that forced me to develop it, was because my application is behind a reverse proxy, wich is not setting the headers x-forwarded-proto. Thus, links sended by mail had an incorrect protocol.

Features include:

  • Set the custom headers
  • Set the priority we want the listener to run when the kernel event.

Build Status

Installation

  1. Download EpilgrimModifyRequestHeadersBundle using composer
  2. Enable the Bundle
  3. Configure your application's config.yml

Step 1: Download EpilgrimModifyRequestHeadersBundle using composer

Add EpilgrimModifyRequestHeadersBundle in your composer.json:

{
    "require": {
        "epilgrim/modify-request-headers-bundle": "*"
    }
}

And then run

$ php composer.phar update

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Epilgrim\ModifyRequestHeadersBundle\EpilgrimModifyRequestHeadersBundle(),
    );
}
  1. Configure your application's config.yml
# app/config/config.yml
epilgrim_modify_request_headers:
    headers:
        - {name: x_forwarded_proto, value: https}
        - {name: header2, value: value_2}
    listener_priority: 64

You can add as many headers as you want.

Notes

It's important to note that the listener_priority must be set higher than the subsequent listener making use of the headers. For example, if you modify the x_forwarded_proto, it is used by the RouterListener (running with priority 32). Thus, you must set something higher. It defaults to 64. If the key epilgrim_modify_request_headers is not added to app/config/config.yml, then the listener won´t be registered.

License

This bundle is under the MIT license.

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固