Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Embedded Static Content Convention Builder #510

Closed

Conversation

logicbomb
Copy link
Contributor

analagous to the StaticContentConventionBuilder but for files that are embedded resources


var ext = Path.GetExtension(nancyContext.Request.Path);

return () => new StreamResponse(() => assemblyContainingResource.GetManifestResourceStream(fullyQualifiedResourceName), MimeTypes.GetMimeType(requestPath));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the resource stream is added directly to the StreamResponse constructor lambda, it gets garbage collected which causes an exception when subsequent Response.Content.Invokes are called. It'd be nice to avoid digging into the manifest every time the response is invoked but I'm not sure how to accomplish that.

@grumpydev
Copy link
Member

Will probably need rebasing, but we will likely pull the embedded stuff into an auto-wiring nuget.

@thecodejunkie
Copy link
Member

This is what we have in mind #732

@grumpydev
Copy link
Member

Closing this as it won't be merged directly but ported for #732.

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

Successfully merging this pull request may close these issues.

None yet

3 participants