From 68d2f17ea18a44d9ef3061ad465694da7363b705 Mon Sep 17 00:00:00 2001 From: Pim Date: Tue, 21 May 2019 23:19:35 +0200 Subject: [PATCH] docs: add tip about lower-case headers (#46) --- docs/api/readme.md | 12 ++++++------ docs/guide/advanced.md | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/api/readme.md b/docs/api/readme.md index ba8762c..beea2f2 100644 --- a/docs/api/readme.md +++ b/docs/api/readme.md @@ -138,7 +138,7 @@ Only efficient when `proxyHeaders` is set to true. Removes unwanted request head Globally set a header to all subsequent requests -See [here](/advanced.html#header-helpers) for usage info +See [here](/guide/advanced.html#header-helpers) for usage info ### `setToken` @@ -146,7 +146,7 @@ See [here](/advanced.html#header-helpers) for usage info Globally set a `Authorization` header for all subsequent requests -See [here](/advanced.html#settoken-token-type) for usage info +See [here](/guide/advanced.html#settoken-token-type) for usage info ## Hooks @@ -156,13 +156,13 @@ The `arguments` listed below are those your hook will receive when it's called - arguments: `(config)` -See [here](/advanced.html#hooks) for usage info +See [here](/guide/advanced.html#hooks) for usage info ### `onResponse` - arguments: `(response)` -See [here](/advanced.html#hooks) for usage info +See [here](/guide/advanced.html#hooks) for usage info ### `onError` @@ -170,12 +170,12 @@ See [here](/advanced.html#hooks) for usage info If the error originated from a request, the property `err.response` might be available -See [here](/advanced.html#hooks) for usage info +See [here](/guide/advanced.html#hooks) for usage info ## HTTP Methods :::tip Usage -See [here](/usage.html#making-requests) for usage information for below methods +See [here](/guide/usage.html#making-requests) for usage information for below methods ::: ### `delete` diff --git a/docs/guide/advanced.md b/docs/guide/advanced.md index 6336b5f..b731c96 100644 --- a/docs/guide/advanced.md +++ b/docs/guide/advanced.md @@ -52,6 +52,12 @@ Globally set a header to all subsequent requests. This method should probably not be called inside hooks as it is global and will apply to all future requests ::: +:::tip +Please note that HTTP headers are case-insensitive. Therefore all header names will be converted to lower-case to make sure that if you set the same header twice but with different casing the last one set will be used. + +See also [this comment](https://github.com/sindresorhus/ky/issues/105#issuecomment-470169100) in the Ky repository for more information +::: + Parameters: * **name**: Name of the header