# Adding a custom Header for Options

**URL:** <https://forum.serverless.com/t/adding-a-custom-header-for-options/2615>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [August 31, 2017, 8:55pm UTC](https://forum.serverless.com/t/adding-a-custom-header-for-options/2615 "2017-08-31T20:55:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srg-avai](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/srg-avai/32/960_2.png) [@srg-avai](https://forum.serverless.com/u/srg-avai)\
**Post date:** [August 31, 2017, 8:55pm UTC](https://forum.serverless.com/t/adding-a-custom-header-for-options/2615/1 "2017-08-31T20:55:06Z")

</div>

We’re using the lambda proxy approach and we’re unable to deploy with a custom header for the options methods. I’ve tried to set the custom header (X-CUSTOM-Auth) on the serverless.yml, e.g.:  
cors: true  
headers:  
- Content-Type  
- X-Amz-Date  
- Authorization  
- X-Api-Key  
- X-Amz-Security-Token  
- X-CUSTOM-Auth

The above doesnt deploy the X-CUSTOM-Auth header to the options method integration response. I have to go manually add it, not ideal and not scaleable with a build process. Anyone else have a way this works??

---

<div class="post-metadata">

**Author:** ![srg-avai](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/srg-avai/32/960_2.png) [@srg-avai](https://forum.serverless.com/u/srg-avai)\
**Post date:** [August 31, 2017, 11:40pm UTC](https://forum.serverless.com/t/adding-a-custom-header-for-options/2615/2 "2017-08-31T23:40:25Z")

</div>

disregard, it was my bad - i was using trying to use the cors: true and set headers… looks like you need to do either or. and use the correct indentation! :-/ hard to tell above since it gets stripped in this editor

---

<div class="post-metadata">

**Author:** ![bfieber](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bfieber/32/653_2.png) [@bfieber](https://forum.serverless.com/u/bfieber)\
**Post date:** [September 1, 2017, 2:37pm UTC](https://forum.serverless.com/t/adding-a-custom-header-for-options/2615/3 "2017-09-01T14:37:09Z")

</div>

not related to cors, but for your indenting issue, add 3 backticks(next to 1 under the ~) above and below your yml snippet and ti will preserve any tabs/spaces/etc…

```auto
example:
  - yippy 
  - I'm helping

```

Hope it helps.
