Skip to content

Allow inserting OWIN middlewares before the WebSharper sitelet #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

psfblair
Copy link

@psfblair psfblair commented Aug 9, 2015

These commits allow middlewares to be inserted into the OWIN pipeline before the WebSharper sitelet; the test application now contains an example that uses OWIN logging middleware to log requests and responses.

These changes do not allow for Middlewares to be inserted in the pipeline after the WebSharper sitelet because SiteletMiddleware generally swallows the call to Next, and how to address that wasn't clear. However, the response logging example shows how the output from the sitelet middleware can still be handled by a middleware that is inserted prior to it in the pipeline.

Two additional notes:

  1. Commit e615b7c introduces a MiddlewareGenerator type in order to allow the IAppBuilder to be passed to middlewares that need it (e.g., middlewares using the OWIN logging framework). This type should really be migrated to WebSharper.Owin once this PR is merged.
  2. The WebSharper.Warp.Test test server now makes use of an OWIN logger. However, using it requires that the WebSharper.Warp.Test.exe.config file be present in the same directory as the executable. This works when compiling using Visual Studio into the bin\Release and bin\Debug directories, but I haven't been able to figure out how to get IntelliFactory.Build to copy the app config file into the build\net45 directory as part of the command-line build. Assistance on that would be appreciated.

type QueryAttribute = Sitelets.QueryAttribute
type FormDataAttribute = Sitelets.FormDataAttribute
type WildCardAttribute = Sitelets.WildcardAttribute
namespace WebSharper
Copy link
Author

Choose a reason for hiding this comment

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

Apologies for the line ending issues.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ Paul Blair
❌ psfblair


Paul Blair seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants