Skip to content

Commit

Permalink
Tweaked README.md/test comments around HTTP header methods
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetikonline committed Oct 22, 2023
1 parent 870031a commit a5e59b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ harness.setBody('data payload',false);
### `setRequestHttpHeader(key[,value])`
### `addRequestHttpHeader(key,value)`

Sets/adds HTTP header items to the request payload:
Sets/adds HTTP headers to the request payload:

```js
const harness = new edgy.EVENT_TYPE_CONSTRUCTOR();
Expand Down Expand Up @@ -415,7 +415,7 @@ harness

harness
.setRequestHttpHeader('User-Agent','xyz')
.setRequestHttpHeader('X-Custom-Header'); // remove header
.setRequestHttpHeader('X-Custom-Header'); // remove HTTP header

/*
{
Expand Down Expand Up @@ -525,7 +525,7 @@ harness
### `setOriginHttpHeader(key[,value])`
### `addOriginHttpHeader(key,value)`

Sets/adds HTTP header items to the origin event payload for [custom](#setorigincustomdomainnamepath) and [s3](#setorigins3domainnameregionpath) targets:
Sets/adds HTTP headers to the origin request payload for [custom](#setorigincustomdomainnamepath) and [S3](#setorigins3domainnameregionpath) targets:

```js
const harness = new edgy.EVENT_TYPE_CONSTRUCTOR();
Expand Down Expand Up @@ -560,7 +560,7 @@ harness
}
*/

harness.setOriginHttpHeader('X-Custom-Header'); // remove header
harness.setOriginHttpHeader('X-Custom-Header'); // remove HTTP header

/*
{
Expand Down
10 changes: 5 additions & 5 deletions test/main-property.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ function testPropertyRequestHttpHeader(inst) {

// set a series of HTTP headers
inst
.setRequestHttpHeader('Multi-Key','single-header') // reduce to a single header
.setRequestHttpHeader('trim'); // remove header
.setRequestHttpHeader('Multi-Key','single-header') // reduce to single HTTP header
.setRequestHttpHeader('trim'); // remove HTTP header

assert.deepEqual(cfEventData(inst).request.headers,
{
Expand Down Expand Up @@ -364,8 +364,8 @@ function testPropertyRequestOrigin(inst) {
);

inst
.setOriginHttpHeader('Multi-Origin-Key','single-header') // reduce to a single header
.setOriginHttpHeader('X-Remove-Me'); // remove header
.setOriginHttpHeader('Multi-Origin-Key','single-header') // reduce to single HTTP header
.setOriginHttpHeader('X-Remove-Me'); // remove HTTP header

assert.deepEqual(cfEventData(inst).request.origin.custom.customHeaders,
{
Expand Down Expand Up @@ -502,7 +502,7 @@ function testPropertyResponseHttpHeader(inst) {
// initial state is an empty header set
assert.deepEqual(cfEventData(inst).response.headers,{});

// note: tested multiple HTTP header combos with `testPropertyRequestHttpHeader()` - so only limited testing here
// note: tested multiple HTTP header combos with `testPropertyRequestHttpHeader()` - so only perform limited testing here
inst
.addResponseHttpHeader('ETag','"e659e87d5a580948081a33d9d0e8d00e"')
.addResponseHttpHeader('Server','AmazonS3');
Expand Down

0 comments on commit a5e59b8

Please sign in to comment.