Skip to content

Commit 8affda0

Browse files
tjsrToriLindsayGregBrimble
authored andcommitted
Add clarification on onRequest call fall-through (#19289)
* Add clarification on onRequest call fall-thgouth Adds clarification that the onRequest function will not be called if another matching function is found. * Update src/content/docs/pages/functions/api-reference.mdx * Update src/content/docs/pages/functions/api-reference.mdx * Update src/content/docs/pages/functions/api-reference.mdx * Update src/content/docs/pages/functions/api-reference.mdx Co-authored-by: Greg Brimble <[email protected]> --------- Co-authored-by: ToriLindsay <[email protected]> Co-authored-by: Greg Brimble <[email protected]>
1 parent c2fe368 commit 8affda0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/docs/pages/functions/api-reference.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ The following methods can be used to configure your Pages Function.
1414

1515
### `onRequests`
1616

17-
17+
The `onRequest` method will be called unless a more specific `onRequestVerb` method is exported. For example, if both `onRequest` and `onRequestGet` are exported, only `onRequestGet` will be called for `GET` requests.
1818

1919
* <code>onRequest(context[EventContext](#eventcontext))</code> Response | Promise\<Response>
20-
* This function will be invoked on all requests no matter the request method.
20+
* This function will be invoked on all requests no matter what the request method is, as long as no specific request verb (like one of the methods below) is exported.
2121
* <code>onRequestGet(context[EventContext](#eventcontext))</code> Response | Promise\<Response>
2222
* This function will be invoked on all `GET` requests.
2323
* <code>onRequestPost(context[EventContext](#eventcontext))</code> Response | Promise\<Response>

0 commit comments

Comments
 (0)