@athenna/http 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenna/http",
3
- "version": "5.26.0",
3
+ "version": "5.27.0",
4
4
  "description": "The Athenna Http server. Built on top of fastify.",
5
5
  "license": "MIT",
6
6
  "author": "João Lenon <lenon@athenna.io>",
@@ -39,10 +39,13 @@ export class TestRequest extends Macroable {
39
39
  * ```
40
40
  */
41
41
  async get(url, options = {}) {
42
+ options.headers = {
43
+ ...this.headers,
44
+ ...options.headers
45
+ };
42
46
  return Server.request({
43
47
  url,
44
48
  method: 'GET',
45
- ...this.headers,
46
49
  ...options
47
50
  }).then(res => this.createResponse(res));
48
51
  }
@@ -57,10 +60,13 @@ export class TestRequest extends Macroable {
57
60
  * ```
58
61
  */
59
62
  async head(url, options = {}) {
63
+ options.headers = {
64
+ ...this.headers,
65
+ ...options.headers
66
+ };
60
67
  return Server.request({
61
68
  url,
62
69
  method: 'HEAD',
63
- ...this.headers,
64
70
  ...options
65
71
  }).then(res => this.createResponse(res));
66
72
  }
@@ -75,10 +81,13 @@ export class TestRequest extends Macroable {
75
81
  * ```
76
82
  */
77
83
  async options(url, options = {}) {
84
+ options.headers = {
85
+ ...this.headers,
86
+ ...options.headers
87
+ };
78
88
  return Server.request({
79
89
  url,
80
90
  method: 'OPTIONS',
81
- ...this.headers,
82
91
  ...options
83
92
  }).then(res => this.createResponse(res));
84
93
  }
@@ -93,10 +102,13 @@ export class TestRequest extends Macroable {
93
102
  * ```
94
103
  */
95
104
  async post(url, options = {}) {
105
+ options.headers = {
106
+ ...this.headers,
107
+ ...options.headers
108
+ };
96
109
  return Server.request({
97
110
  url,
98
111
  method: 'POST',
99
- ...this.headers,
100
112
  ...options
101
113
  }).then(res => this.createResponse(res));
102
114
  }
@@ -111,10 +123,13 @@ export class TestRequest extends Macroable {
111
123
  * ```
112
124
  */
113
125
  async put(url, options = {}) {
126
+ options.headers = {
127
+ ...this.headers,
128
+ ...options.headers
129
+ };
114
130
  return Server.request({
115
131
  url,
116
132
  method: 'PUT',
117
- ...this.headers,
118
133
  ...options
119
134
  }).then(res => this.createResponse(res));
120
135
  }
@@ -129,10 +144,13 @@ export class TestRequest extends Macroable {
129
144
  * ```
130
145
  */
131
146
  async patch(url, options = {}) {
147
+ options.headers = {
148
+ ...this.headers,
149
+ ...options.headers
150
+ };
132
151
  return Server.request({
133
152
  url,
134
153
  method: 'PATCH',
135
- ...this.headers,
136
154
  ...options
137
155
  }).then(res => this.createResponse(res));
138
156
  }
@@ -147,10 +165,13 @@ export class TestRequest extends Macroable {
147
165
  * ```
148
166
  */
149
167
  async delete(url, options = {}) {
168
+ options.headers = {
169
+ ...this.headers,
170
+ ...options.headers
171
+ };
150
172
  return Server.request({
151
173
  url,
152
174
  method: 'DELETE',
153
- ...this.headers,
154
175
  ...options
155
176
  }).then(res => this.createResponse(res));
156
177
  }