Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(etag): allow for custom hashing methods to be used to etag #3832

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

EdamAme-x
Copy link
Contributor

@EdamAme-x EdamAme-x commented Jan 15, 2025

resolve: #3829

const app = new Hono()

app.use(
  '/etag/*',
  etag({
    generateDigest: (body: Uint8Array) =>
      crypto.subtle.digest({
          name: 'SHA-256',
        },
        body
      ),
  })
)

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

@EdamAme-x
Copy link
Contributor Author

Can you review this?
@Gobd @usualoma

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.71%. Comparing base (2a68c59) to head (929ae30).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3832   +/-   ##
=======================================
  Coverage   91.71%   91.71%           
=======================================
  Files         160      160           
  Lines       10195    10198    +3     
  Branches     2925     2890   -35     
=======================================
+ Hits         9350     9353    +3     
  Misses        844      844           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gobd
Copy link

Gobd commented Jan 15, 2025

I'll try it out later today

@EdamAme-x
Copy link
Contributor Author

@Gobd Sorry for ping, how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for custom hashing methods to be used to etag
2 participants