File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,15 @@ export async function handle({ request, resolve }) {
5
5
const cookies = cookie . parse ( request . headers . cookie || '' ) ;
6
6
request . locals . userid = cookies . userid || uuid ( ) ;
7
7
8
- // TODO https://github.com/sveltejs/kit/issues/1046
9
- if ( request . query . has ( '_method' ) ) {
10
- request . method = request . query . get ( '_method' ) . toUpperCase ( ) ;
11
- }
12
-
13
8
const response = await resolve ( request ) ;
14
9
15
10
if ( ! cookies . userid ) {
16
11
// if this is the first time the user has visited this app,
17
12
// set a cookie so that we recognise them when they return
18
- response . headers [ 'set-cookie' ] = `userid=${ request . locals . userid } ; Path=/; HttpOnly` ;
13
+ response . headers [ 'set-cookie' ] = cookie . serialize ( 'userid' , request . locals . userid , {
14
+ path : '/' ,
15
+ httpOnly : true
16
+ } ) ;
19
17
}
20
18
21
19
return response ;
Original file line number Diff line number Diff line change 6
6
7
7
<header class =" header" >
8
8
<span class =" title" >svelte-eslint-parser</span >
9
- <a class ="menu" class:active ={$page .path === ' /' } sveltekit:prefetch href =" {baseUrl }/" >AST</a >
10
9
<a
11
10
class =" menu"
12
- class:active ={$page .path === ' /playground' }
11
+ class:active ={$page .url .pathname === ` ${baseUrl }/ ` }
12
+ sveltekit:prefetch
13
+ href =" {baseUrl }/" >AST</a
14
+ >
15
+ <a
16
+ class =" menu"
17
+ class:active ={$page .url .pathname === ` ${baseUrl }/playground ` }
13
18
sveltekit:prefetch
14
19
href =" {baseUrl }/playground" >Playgroud</a
15
20
>
16
- <a class ="menu" class:active ={$page .path === ' /scope' } sveltekit:prefetch href =" {baseUrl }/scope"
17
- >Scope</a
21
+ <a
22
+ class =" menu"
23
+ class:active ={$page .url .pathname === ` ${baseUrl }/scope ` }
24
+ sveltekit:prefetch
25
+ href =" {baseUrl }/scope" >Scope</a
18
26
>
19
27
<SnsBar />
20
28
<a href =" https://github.com/ota-meshi/svelte-eslint-parser" class =" github-link" >View on GitHub</a >
You can’t perform that action at this time.
0 commit comments