url regexp for file suffix?

11 views
Skip to first unread message

tark...@gmail.com

unread,
Aug 11, 2015, 5:33:52 PM8/11/15
to onion-dev
Hello,
  I am trying to implement dynamic content generation using libonion.
For early development, I just used a root handler for everything.
Now I am at a point where I need to mix in requests for static content.

  My question is, how do phrase a regexp to match just a specific file suffix?
I tried *.cgi, and *\\.cgi (double slash to escape in C), $.cgi, and $\\.cgi,
 but I still get 404s.

Thank you for your time,
  Steve

tark...@gmail.com

unread,
Aug 11, 2015, 5:50:10 PM8/11/15
to onion-dev, tark...@gmail.com

Sorry to reply to my own post, but it might help someone else.

I am a bit rusty with regexes, so I turned to an online tester.
What worked to match .cgi suffixes (extra slash for C escape):
^(.*)\\.cgi$

Thanks, and sorry for the noise,
  Steve
Reply all
Reply to author
Forward
0 new messages