Skip to content

Commit

Permalink
Fix headers validation for requests that receive empty headers
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym committed Dec 7, 2024
1 parent a946ae5 commit ae9bc13
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 69 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/create-pullrequest-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,44 @@ jobs:
with:
name: npm-package-chanfana-${{ github.event.number }} # encode the PR number into the artifact name
path: chanfana-*.tgz

- name: 'Put PR and workflow ID on the environment'
uses: actions/github-script@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
for (const artifact of allArtifacts.data.artifacts) {
// Extract the PR number from the artifact name
const match = /^npm-package-chanfana-(\d+)$/.exec(artifact.name);
if (match) {
require("fs").appendFileSync(
process.env.GITHUB_ENV,
`\nWORKFLOW_RUN_PR=${match[1]}` +
`\nWORKFLOW_RUN_ID=${context.payload.workflow_run.id}`
);
break;
}
}
- name: 'Comment on PR with Link'
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ env.WORKFLOW_RUN_PR }}
message: |
🧪 A prerelease is available for testing 🧪
You can install this latest build in your project with:
```sh
npm install --save https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-chanfana-${{ env.WORKFLOW_RUN_PR }}
```
Or you can immediately run this with `npx`:
```sh
npx https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-chanfana-${{ env.WORKFLOW_RUN_PR }}
```
53 changes: 0 additions & 53 deletions .github/workflows/write-prerelease-comment.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ library for Cloudflare Workers but runs on any runtime supported by the base rou
The key features are:

- OpenAPI 3 and 3.1 schema generator and validator
- Query, Path, Headers and Body typescript inference
- [Query](https://chanfana.pages.dev/user-guide/query-parameters/), [Path](https://chanfana.pages.dev/user-guide/path-parameters/), [Headers](https://chanfana.pages.dev/user-guide/header-parameters/) and [Body](https://chanfana.pages.dev/user-guide/request-body/) typescript inference
- Fully written in typescript
- Class-based endpoints
- Extend existing Hono, itty-router, etc application, without touching old routes
- [Class-based endpoints](https://chanfana.pages.dev/user-guide/first-steps/)
- Extend existing [Hono](https://chanfana.pages.dev/routers/hono/), [itty-router](https://chanfana.pages.dev/routers/itty-router/), etc application, without touching old routes

## Getting started

Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ nav:
- user-guide/first-steps.md
- user-guide/path-parameters.md
- user-guide/query-parameters.md
- user-guide/header-parameters.md
- user-guide/request-body.md
- user-guide/response-format.md
- user-guide/router-options.md
Expand Down
75 changes: 71 additions & 4 deletions docs/pages/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ library for Cloudflare Workers but runs on any runtime supported by the base rou
The key features are:

- OpenAPI 3 and 3.1 schema generator and validator
- Query, Path, Headers and Body typescript inference
- [Query](https://chanfana.pages.dev/user-guide/query-parameters/), [Path](https://chanfana.pages.dev/user-guide/path-parameters/), [Headers](https://chanfana.pages.dev/user-guide/header-parameters/) and [Body](https://chanfana.pages.dev/user-guide/request-body/) typescript inference
- Fully written in typescript
- Class-based endpoints
- Extend existing Hono, itty-router, etc application, without touching old routes
- [Class-based endpoints](https://chanfana.pages.dev/user-guide/first-steps/)
- Extend existing [Hono](https://chanfana.pages.dev/routers/hono/), [itty-router](https://chanfana.pages.dev/routers/itty-router/), etc application, without touching old routes

## Getting started

Expand Down
Loading

0 comments on commit ae9bc13

Please sign in to comment.