File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -418,11 +418,11 @@ And a method:
418
418
A method to simplify redirecting the response to another URL. It will set the
419
419
` Location ` header to the supplied ` url ` and the status to ` 302 Found ` (unless
420
420
the status is already a ` 3XX ` status). The use of symbol ` REDIRECT_BACK ` as
421
- the ` url ` indicates that the ` Referrer ` header in the request should be used
422
- as the direction, with the ` alt ` being the alternative location if the
423
- ` Referrer ` is not set. If neither the ` alt ` nor the ` Referrer ` are set, the
424
- redirect will occur to ` / ` . A basic HTML (if the requestor supports it) or a
425
- text body will be set explaining they are being redirected.
421
+ the ` url ` indicates that the ` Referer ` header in the request should be used as
422
+ the direction, with the ` alt ` being the alternative location if the ` Referer `
423
+ is not set. If neither the ` alt ` nor the ` Referer ` are set, the redirect will
424
+ occur to ` / ` . A basic HTML (if the requestor supports it) or a text body will
425
+ be set explaining they are being redirected.
426
426
427
427
### Automatic response body handling
428
428
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ await app.listen({ port: 8000 });
76
76
```
77
77
78
78
The symbol ` REDIRECT_BACK ` can be used to redirect the requestor back to the to
79
- the referrer (if the request's ` Referrer ` header has been set), and the second
79
+ the referrer (if the request's ` Referer ` header has been set), and the second
80
80
argument can be used to provide a "backup" if there is no referrer. For example:
81
81
82
82
``` ts
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export class Response {
292
292
alt : string | URL = "/" ,
293
293
) : void {
294
294
if ( url === REDIRECT_BACK ) {
295
- url = this . #request. headers . get ( "Referrer " ) ?? String ( alt ) ;
295
+ url = this . #request. headers . get ( "Referer " ) ?? String ( alt ) ;
296
296
} else if ( typeof url === "object" ) {
297
297
url = String ( url ) ;
298
298
}
You can’t perform that action at this time.
0 commit comments