Skip to content

Commit

Permalink
type fix: header should be headers (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcelhaney committed Jan 16, 2025
1 parent b4185ba commit 0641f50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ return $.response[200].header("x-coolness-level", 10).text("This is cool!")`.

### Request parameters

Most of the time, the server's response depends on input from various parts of the request, which are accessible through `$.path`, `$.query`, `$.header`, and `$.body`. The best way to explain is with an example:
Most of the time, the server's response depends on input from various parts of the request, which are accessible through `$.path`, `$.query`, `$.headers`, and `$.body`. The best way to explain is with an example:

```ts
export const GET: HTTP_GET = ($) => {
if ($.header['x-token'] !== 'super-secret') {
if ($.headers['x-token'] !== 'super-secret') {
return $.response[401].text('unauthorized');
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ interface WideResponseBuilder {
interface WideOperationArgument {
body: unknown;
context: unknown;
header: { [key: string]: string };
headers: { [key: string]: string };
path: { [key: string]: string };
proxy: (url: string) => { proxyUrl: string };
query: { [key: string]: string };
Expand Down

0 comments on commit 0641f50

Please sign in to comment.