-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Dynamic Models): together AI Dynamic Models
- Loading branch information
1 parent
115dcbb
commit 1589d2a
Showing
6 changed files
with
113 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export function parseCookies(cookieHeader: string) { | ||
const cookies: any = {}; | ||
|
||
// Split the cookie string by semicolons and spaces | ||
const items = cookieHeader.split(';').map((cookie) => cookie.trim()); | ||
|
||
items.forEach((item) => { | ||
const [name, ...rest] = item.split('='); | ||
|
||
if (name && rest) { | ||
// Decode the name and value, and join value parts in case it contains '=' | ||
const decodedName = decodeURIComponent(name.trim()); | ||
const decodedValue = decodeURIComponent(rest.join('=').trim()); | ||
cookies[decodedName] = decodedValue; | ||
} | ||
}); | ||
|
||
return cookies; | ||
} |
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