Is it possible to forward Prefix in content?

21 views
Skip to first unread message

Jiří Sedláček

unread,
May 28, 2013, 10:46:06 AM5/28/13
to zer...@googlegroups.com
Is it somehow possible to forward the matched part of URL (like !Prefix) in the contents section?

My goal is to use zerogw url matching and refrain from doing it again on the backend. So I would need from zerogw to tell the backend which key from map was matched.

If there is

map:
    /hello*

and request asks for /hello/world

then I would need to get

Prefix = /hello or Prefix = /hello/*

Jiri

PS: it could also be achieved by specifying an arbitrary key that would be set for every path like this (does not work):

contents:
- !Method
- MySpecialValue





Frédéric Logier

unread,
May 28, 2013, 12:04:12 PM5/28/13
to zer...@googlegroups.com
With !Uri you will get the full url : /hello/world, so you have to split the string on the / 


2013/5/28 Jiří Sedláček <yirie.se...@gmail.com>





--
You received this message because you are subscribed to the Google Groups "Zerogw" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zerogw+un...@googlegroups.com.
To post to this group, send email to zer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zerogw/9858dce8-f9d3-4f5c-a206-762f864e6eb0%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
http://fredix.wordpress.com

Jiří Sedláček

unread,
May 28, 2013, 12:16:39 PM5/28/13
to zer...@googlegroups.com
Yes, but the splitting etc. has already been done by zerogw. Why repeat it? Not to say that it might be more complex then splitting by slash.
You received this message because you are subscribed to a topic in the Google Groups "Zerogw" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zerogw/APHfh3sjT9A/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to zerogw+un...@googlegroups.com.

To post to this group, send email to zer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zerogw/CABGJcNOA0n2GgaqCT7WwLZng%2BotVV_KU5XLsFnxGPKdJLDW28Q%40mail.gmail.com?hl=en.

Paul Colomiets

unread,
May 28, 2013, 4:26:41 PM5/28/13
to zer...@googlegroups.com
Hi Jiri,

On Tue, May 28, 2013 at 5:46 PM, Jiří Sedláček
<yirie.se...@gmail.com> wrote:
> PS: it could also be achieved by specifying an arbitrary key that would be
> set for every path like this (does not work):
>
> contents:
> - !Method
> - MySpecialValue
>
>

I would write this as:

contents:
- !Method
- !Literal "MySpecialValue"

To be explicit. It's easy to implement. But I fear to do it in hurry,
now :) You can do a pull request or I can implement it next week.

--
Paul

Jiří Sedláček

unread,
May 28, 2013, 6:42:36 PM5/28/13
to zer...@googlegroups.com
Hi Paul,

Did you mean something like this?

https://github.com/towhans/zerogw/commit/1198d6ea6653247daf9acec12a700301e1b52916

Jiri
> --
> You received this message because you are subscribed to a topic in the Google Groups "Zerogw" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/zerogw/APHfh3sjT9A/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to zerogw+un...@googlegroups.com.
> To post to this group, send email to zer...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/zerogw/CAA0gF6pqrVPzrgGP7Hb2swEEPy%2BSYqNjm0HpG4sRvBbtUnGD2Q%40mail.gmail.com?hl=en.

Paul Colomiets

unread,
May 29, 2013, 3:49:54 AM5/29/13
to zer...@googlegroups.com
Hi Jiri,

On Wed, May 29, 2013 at 1:42 AM, Jiří Sedláček
<yirie.se...@gmail.com> wrote:
> Hi Paul,
>
> Did you mean something like this?
>
> https://github.com/towhans/zerogw/commit/1198d6ea6653247daf9acec12a700301e1b52916
>

Yes

--
Paul
Reply all
Reply to author
Forward
0 new messages