From 505a3bf657f1f2a25d440256ddb151863a56bad5 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sun, 5 Sep 2010 17:09:59 +0000 Subject: [PATCH] Fixed a critical bug in redirects handling --- IISMainHandler/handlers/AbstractGetHandler.cs | 4 ++++ IISMainHandler/handlers/request/AbstractPostHandler.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/IISMainHandler/handlers/AbstractGetHandler.cs b/IISMainHandler/handlers/AbstractGetHandler.cs index 4acb975..0a54505 100644 --- a/IISMainHandler/handlers/AbstractGetHandler.cs +++ b/IISMainHandler/handlers/AbstractGetHandler.cs @@ -36,6 +36,10 @@ namespace FLocal.IISHandler.handlers { public void Handle(WebContext context) { try { context.httpresponse.Write(context.Transform(this.templateName, this.getData(context))); + } catch(RedirectException) { + throw; + } catch(WrongUrlException) { + throw; } catch(Exception e) { context.LogError(e); context.httpresponse.Write(context.Transform("Exception.xslt", new XDocument(new XElement("root", this.getCommonData(context), e.ToXml())))); diff --git a/IISMainHandler/handlers/request/AbstractPostHandler.cs b/IISMainHandler/handlers/request/AbstractPostHandler.cs index a6a7212..075b6a0 100644 --- a/IISMainHandler/handlers/request/AbstractPostHandler.cs +++ b/IISMainHandler/handlers/request/AbstractPostHandler.cs @@ -56,6 +56,10 @@ namespace FLocal.IISHandler.handlers.request { if(this.shouldBeGuest && context.session != null) throw new FLocalException("Should be guest"); if(this.shouldBeLoggedIn && context.session == null) throw new FLocalException("Should be anonymous"); context.httpresponse.Write(context.Transform(this.templateName, this.getData(context))); + } catch(RedirectException) { + throw; + } catch(WrongUrlException) { + throw; } catch(Exception e) { context.LogError(e); context.httpresponse.Write(context.Transform("Exception.xslt", new XDocument(new XElement("root", this.getCommonData(context), e.ToXml()))));