File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 200
200
event.respondWith((async () => {
201
201
const formData = await event.request.formData();
202
202
const link = formData.get('link') || '';
203
- saveBookmark(link);
204
- return new Response('Bookmark saved: ' + link );
203
+ const responseUrl = await saveBookmark(link);
204
+ return Response.redirect(responseUrl, 303 );
205
205
})());
206
206
});
207
207
</ pre >
@@ -268,6 +268,12 @@ <h2>
268
268
< code > url</ code > with a short link to fit into the message size.
269
269
</ li >
270
270
</ ul >
271
+ < p >
272
+ As with HTML forms, replying to a POST request with a
273
+ < a data-cite ="!RFC7231#section-6.4.4 "> 303 See Other</ a > redirect
274
+ is highly recommended, as it avoids the POST being submitted a
275
+ second time if the user requests a page refresh.
276
+ </ p >
271
277
</ section >
272
278
< section data-link-for ="WebAppManifest ">
273
279
< h2 >
You can’t perform that action at this time.
0 commit comments