codacus commited on
Commit
7192690
·
1 Parent(s): 1589d2a
app/utils/constants.ts CHANGED
@@ -1,5 +1,4 @@
1
  import Cookies from 'js-cookie';
2
- import { parseCookies } from './parseCookies';
3
  import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types';
4
  import type { ProviderInfo } from '~/types/model';
5
 
 
1
  import Cookies from 'js-cookie';
 
2
  import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types';
3
  import type { ProviderInfo } from '~/types/model';
4
 
app/utils/parseCookies.ts DELETED
@@ -1,19 +0,0 @@
1
- export function parseCookies(cookieHeader: string) {
2
- const cookies: any = {};
3
-
4
- // Split the cookie string by semicolons and spaces
5
- const items = cookieHeader.split(';').map((cookie) => cookie.trim());
6
-
7
- items.forEach((item) => {
8
- const [name, ...rest] = item.split('=');
9
-
10
- if (name && rest) {
11
- // Decode the name and value, and join value parts in case it contains '='
12
- const decodedName = decodeURIComponent(name.trim());
13
- const decodedValue = decodeURIComponent(rest.join('=').trim());
14
- cookies[decodedName] = decodedValue;
15
- }
16
- });
17
-
18
- return cookies;
19
- }