Comments (2)
I am not a fan of this feature, but this is mainly a performance / implementation complexity concern. The mentioned use-case already has a high-performing solution, so I would be disinclined to add this on the basis of that only.
The issue is validation and massaging of the options. Running a full schema validation on each invocation is prohibitively expensive. The alternative solution, which is used for the file handler, is to not use the full schema validation, but a custom simpler validation. However this requires a lot of care to get right, and makes the code / interface more brittle.
from inert.
Given that the options passed to h.directory
are probably quite static, the above issue could be fixed by exposing a method to prevalidate them, and allow (or require) the options to be the return value of this pre-validation.
from inert.
Related Issues (20)
- Catching errors for directory handler HOT 5
- Action required: Greenkeeper could not be activated 🚨 HOT 1
- Update joi HOT 1
- I'm upgrading hapi from v16 to v17 and trying to register plugins but getting error as- AssertionError [ERR_ASSERTION]: Invalid plugin options HOT 1
- Problem with serving static file HOT 1
- Only node 12
- Require hapi 19
- Change plugin name to @hapi/inert
- 6.0.1 should be 7.0.0 because it required hapi 19 whereas 6.0.0 does not HOT 4
- @hapi/ammo - Denial of Service HOT 1
- Directory listings fail with a 500 when path is absolute HOT 1
- `redirectToSlash` not being applied HOT 2
- Add an option to prevent following symlinks HOT 6
- Allow path functions to be async HOT 10
- Disabling `must-revalidate` when serving static files via Inert HOT 1
- Invalid "inert" server options issue after Hapi update to 20.2.2 : HOT 5
- Release Notes 7.0.0 HOT 3
- SVG files being served as text/plain instead of image/svg, how do I fix this?
- Error: Failed to open file: ENAMETOOLONG HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inert.