-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(execute): create RFC 6265 compliant Cookie headers
Every Cookie header produced by this library can now be properly parsed by RFC 6265 parser, and resulting cookie-value can be further percent decoded and processed by RFC 6570 implementations
- Loading branch information
Showing
5 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { cookieValueStrictEncoder } from '@swaggerexpert/cookie'; | ||
|
||
const eqSignPE = '%3D'; | ||
const ampersandPE = '%26'; | ||
|
||
const cookieValueEncoder = (cookieValue) => | ||
cookieValueStrictEncoder(cookieValue).replace(/[=&]/gu, (match) => | ||
match === '=' ? eqSignPE : ampersandPE | ||
); | ||
|
||
export default cookieValueEncoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters