Commit 79424b2
authored
fix: add cookie support for HTTP bearer authentication (#949)
* fix: add cookie support for HTTP bearer authentication
- Updated validateHttp() to handle bearer tokens in both authorization header and cookies.
- Adapted logic to ensure flexibility for projects using HTTP-only cookies instead of headers for authentication.
* fix: Refine HTTP authentication validation based on code review feedback
- Maintain existing error for missing Authorization header
- Add specific error for cookie authentication when specified in security scheme
- Consider both Authorization header and cookie for bearer token validation
* fix: Revert unintended code style changes made during previous commit
* fix: Revert unintended code style changes made during previous commit
* fix: fix: update validateHttp to handle missing auth headers properly
- Restructure Basic auth validation to check header existence first
- Maintain original error messages for non-cookie authentication
- Add proper cookie authentication check when specified
- Fix undefined.includes() error in Basic auth validation1 parent 94a281c commit 79424b2
1 file changed
+26
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
240 | 238 | | |
241 | | - | |
242 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
243 | 251 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| |||
276 | 289 | | |
277 | 290 | | |
278 | 291 | | |
279 | | - | |
| 292 | + | |
0 commit comments