stretchr / goweb

A lightweight RESTful web framework for Go
632 stars 61 forks source link

MapFunc matching all substrings #9

Closed Nican closed 11 years ago

Nican commented 11 years ago

I am having an issue such that MapFunc is matching anything with the sub string of the path. For example:

goweb.MapFunc("/a", serverA)
goweb.MapFunc("/nota", serverB)

And any page containing "a" will call serverA, including "localhost:8080/nota", and for example, "localhost:8080/ishouldbe404a" is also calling serveA.

matryer commented 11 years ago

Yes - this is fixed in Goweb 2 (the v2 branch) but its not 100% ready. Meanwhile, be more specific first (I.e switch them around)

Sent from my iPhone

On 5 May 2013, at 06:30, Nican notifications@github.com wrote:

I am having an issue such that MapFunc is matching anything with the sub string of the path. For example:

goweb.MapFunc("/a", serverA) goweb.MapFunc("/nota", serverB) And any page containing "a" will call serverA, including "localhost:8080/nota", and for example, "localhost:8080/ishouldbe404a" is also calling serveA.

— Reply to this email directly or view it on GitHub.

matryer commented 11 years ago

UPDATE: Goweb 2 is ready... and your code will work properly if you use it.

matryer commented 11 years ago

This is fixed in Goweb 2