That probably won't work as RewriteRequest is already a case class which means that unapply is defined. AFAIK building an extractor that yields different types is not possible . For instance we can not have:
def unapply(r: RewriteRequest): Option[(ParseHost, ParsePath, RequestType, HttpServletRequest)] = ... and def unapply(r: RewriteRequest): Option[ParsePath, RequestType, HttpServletRequest)] = ... as it is not a valid overloading. Br's, Marius On Jul 26, 4:45 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote: > It doesn't necessarily have to be a breaking change. See for example > scala.xml.QNode. > > ------------------------------------- > > marius d.<marius.dan...@gmail.com> wrote: > > Well RewriteRequest/Response are currently defined as: > > case class RewriteRequest(path: ParsePath, requestType: RequestType, > httpRequest: HttpServletRequest) > case class RewriteResponse(path: ParsePath, params: Map[String, > String], stopRewriting: Boolean) > > so having HttpServketRequest in RewriteRequest, you have access to the > hostname and generate different Rewrite response. For example having a > host such as marius.basecamphq.com you can easily turn it into > basecamphq.com/marius. > > The only "problem" here is that you can not pattern match by host name > currently. Probably as we have a ParsePath we can have a ParseHost > such as marius.basecamphq.com would become "marius" :: "basecamphq" :: > "com" :: Nil. Having case class ParseHosth(parts: List[String]) > > RewriteRequest would become: > > case class RewriteRequest(host: ParseHost, path: ParsePath, > requestType: RequestType, httpRequest: HttpServletRequest) > > .. now you would be able to pattern match by hostname fragments etc. > > This is just A WAY to make things easier for your usecase but to make > it happen we need committers consensus as this implies API change and > inherently breaking changes. > > Br's, > Marius > > On Jul 26, 2:02 pm, JanWillem Tulp <janwillem.t...@gmail.com> wrote: > > > Yeah, Marius, you're right. > > > I was just wondering how they've implemented this feature, for example > > atwww.basecamphq.com. If you signup, you get a URL that starts with > > your account name, something like: myacount.basecamphq.com. > > > How is that done? Or better, how to do something similar in Lift? > > > Thanks! > > > On Jul 26, 12:01 pm, Timothy Perrett <timo...@getintheloop.eu> wrote: > > > > Id say this is a fairly common idiom with multi-tenant systems... > > > > Cheers, Tim > > > > On Jul 26, 8:30 am, "marius d." <marius.dan...@gmail.com> wrote: > > > > > What is the usecase of rewriting the hostname? ... Having multiple > > > > subdomains mapped to the same IP address and want to discriminate > > > > them? > > > > > Br's, > > > > Marius > > > > > On Jul 26, 1:22 am, JanWillem Tulp <janwillem.t...@gmail.com> wrote: > > > > > > Hi all, > > > > > > most examples I have seen about Lift URL rewriting are about the path > > > > > of the URL, the part that comes after the hostname (and port). But is > > > > > it also possible to do URL rewriting on subdomains? > > > > > > For instance, can I rewrite a URL where the account name is used as a > > > > > subdomain, something like:http://myaccount.example.comsothatit > > > > > maps to something similar tohttp://www.example.com?account=myaccount > > > > > > And is URL rewriting for subdomains always possible, or are there some > > > > > prerequisities from a hosting company or something? > > > > > > Thanks! > > > > > > JanWillem Tulp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---