Closed dirkbolte closed 11 months ago
I have a static asset without an extension (in my case , a file called
userinfo
as I'm mimicing an OIDC server ). In the default implementation, this results in the following error:TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "Content-Type"
.I ended up patching the package to add the file + content type I needed.
It would be great if this plugin would provide the following functionalities:
- have a default mime type when none was found
instead of
undefined+ an error when running with
vite`)- allow to overwrite said default
- add custom mime types
- extend mime type check to support the actual filename and/or a glob
What a great feature suggestion!! I will add that feature to the plugin soon. Thank you very much
greeting the new day! I have provided version 1.2.3
. You can extend the content type by adding config:
const dirAssets=["libs/assets","repo1/assets",...];
export default defineConfig({
plugins: [
DynamicPublicDirectory(dirAssets,{
'.ac':'application/acc'
})
]
})
I have added error handling, if the content type is not there it will be handled according to the mime-types library. You can try again, and if the problem is resolved, please help me close this issue!!
thanks. Will take a bit but you will get feedback throughout the day.
seems to work. Awesome!! Thanks for the quick reaction.
seems to work. Awesome!! Thanks for the quick reaction.
tks so much!!!
I have a static asset without an extension (in my case , a file called
userinfo
as I'm mimicing an OIDC server ). In the default implementation, this results in the following error:TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "Content-Type"
.I ended up patching the package to add the file + content type I needed.
It would be great if this plugin would provide the following functionalities:
undefined
+ an error when running withvite
)