Posts Tagged 'Internet'

ASP.NET GlobalFilters, except this one page

If you are an ASP.NET web dev, you probably know about GlobalFilters.  You can apply an ActionFilter attribute globally.  It’s super useful for things like RequireHttps.  Unless you have one page that you want to exclude from that requirement.  Maybe you have AuthorizeAttribute sprinkled around because everything on your site is secure except, obviously, the login page.  Maybe, like me, you have a health check page that you want accessible via HTTP, while everything else is forced to HTTPS, or maybe there is some other use case.  At any rate, I found a good solution, implemented it, and then had to remove it because things took a different direction.  So, I am writing this mostly so I don’t forget about it, because it’s a pattern that I’ve wondered about before and never found a good answer.

Searching for what others have done in this case is actually a little difficult.  The terms for what you want to accomplish – filter, exclude, except – are all pretty generic.  The specific ASP.NET classes and fields are subjects of many unrelated articles, so that doesn’t really help.  Phil Haack has an interesting approach, but ultimately, I prefer declaring rules or exceptions inline as attributes. What I had adapted, before pulling it back out, was a nice approach outlined by Ori Calvo.

If you need to implement a similar setup, check out both approaches, and see if one of them will work for you!

Advertisements

Personal Websites

I just re-registered the mattschuette.com domain after a few weeks of it being expired and nearly past the grace period. It got me thinking about what a personal website is for these days. We have several social websites for day-to-day thoughts, text messaging or maybe an IM for more immediate needs, flickr or other sites for pictures (though probably just on a social network), and LinkedIn for resumes. What is left?

Why do people have personal websites now? If you have code to share, put it on github or wherever. I guess there’s the about page, but static content is boring. I enjoyed maintaining my own webserver, but what’s the point? For that matter, why have a blog? Most of my posts, not that there are many, lately are just rants or screeds, and that gets old after maybe two.

So I’m honestly asking any friends still stopping by here or random passers-by — what are the reasons? What is interesting to read about? What content rises above just ego stroking?


Posts

November 2017
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

del.icio.us bookmarks

Thanks

I would like to thank Mike Hellrich for hosting a couple redirects for me while I sort out my web server problems.