Skip to content

Conversation

@jsumners
Copy link
Member

@jsumners jsumners commented Jul 3, 2024

As titled.

bilalshareef and others added 2 commits July 5, 2024 06:38
* Update for v5

* c8 ignore

* remove dep

* c8

---------

Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
@jsumners
Copy link
Member Author

@climba03003 please resolve the issues here.

fastify-static on  next
❯ rg 'stream\.on'
index.js
227:    stream.on('file', function (file) {
273:      stream.on('headers', setHeaders)
276:    stream.on('directory', function (_, path) {
314:    stream.on('error', function (err) {

fastify-static/index.js

Lines 224 to 229 in c569cf3

// `send(..., path, ...)` will URI-decode path so we pass an encoded path here
const stream = send(request.raw, encodeURI(pathnameForSend), options)
let resolvedFilename
stream.on('file', function (file) {
resolvedFilename = file
})

@climba03003
Copy link
Member

please resolve the issues here.

Since the structure and feature is drastically changed.
I / We need to comes up an idea on how to solve on @fastify/send first.
For example, the directory and file event.

@jsumners
Copy link
Member Author

I don't use either of the modules in question. All I know is that @fastify/send is a dependency here, and that it was recently changed to remove the exported event emitter. I would have solved the issues here if the changes were minor. As it is, I suggest re-adding the event emitter to @fastify/send such that this module can be updated easily.

* chore!: bump dependency send@3

* fixup

* fixup

* chore: use v5 workflow

* chore: bump dependency send@3.1.0

* fixup
reply.redirect(301, getRedirectUrl(request.raw.url))
} /* c8 ignore start */ catch (error) {
// the try-catch here is actually unreachable, but we keep it for safety and prevent DoS attack
await reply.send(error)

Check warning

Code scanning / CodeQL

Information exposure through a stack trace

This information exposed to the user depends on [stack trace information](1).
@jsumners jsumners marked this pull request as ready for review July 12, 2024 10:38
@jsumners jsumners merged commit 1e041d7 into master Jul 12, 2024
@jsumners jsumners deleted the next branch July 12, 2024 10:42
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.

4 participants