Embedded Static Content Convention Builder #510

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

logicbomb commented Feb 17, 2012

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));
@logicbomb

logicbomb Feb 17, 2012

Contributor

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.

+ nancyContext.Trace.TraceLog.WriteLog(x => x.AppendLine(
+ string.Format(
+ "[EmbeddedStaticContentConventionBuilder] A request was recieved for the embedded resource {0}", nancyContext.Request.Url)));
+
@logicbomb

logicbomb Feb 17, 2012

Contributor

this statement is in the wrong place, it should be on line 36

Owner

grumpydev commented Sep 5, 2012

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

Owner

thecodejunkie commented Sep 5, 2012

This is what we have in mind #732

Owner

grumpydev commented Feb 16, 2013

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

@grumpydev grumpydev closed this Feb 16, 2013

@jrsconfitto jrsconfitto referenced this pull request Nov 19, 2013

Closed

Improve support for embedded resources and NuGet it up #1331

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment