Skip to content

Commit

Permalink
fix sites validation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Clitheroe committed Mar 12, 2018
1 parent 4d8fcce commit 6579180
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/fits-api/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var routes = wt.Requests{
{ID: wt.L(), Accept: svg, Content: svg, URL: "/plot?typeID=t1&sites=TEST1,TEST2&days=4000"},
{ID: wt.L(), Accept: svg, Content: svg, URL: "/plot?typeID=t1&sites=TEST1,TEST2&days=4000&start=2010-11-24T00:00:00Z"},
{ID: wt.L(), Accept: svg, Content: svg, URL: "/plot?typeID=t1&sites=TEST1,TEST2&start=2010-11-24T00:00:00Z"},
{ID: wt.L(), Accept: svg, Content: svg, URL: "/plot?typeID=t1&sites=T1.TEST1,T1.TEST2&start=2010-11-24T00:00:00Z"},

{ID: wt.L(), Accept: svg, Content: svg, URL: "/spark?typeID=t1&siteID=TEST1"},
{ID: wt.L(), Accept: svg, Content: svg, URL: "/spark?typeID=t1&siteID=TEST1&days=12"},
Expand Down
2 changes: 1 addition & 1 deletion internal/valid/valid.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
//within e.g., POLYGON((177.18+-37.52,177.19+-37.52,177.20+-37.53,177.18+-37.52))

var (
textRE, textErr = regexp.Compile(`^[0-9a-zA-Z\-\,]+$`)
textRE, textErr = regexp.Compile(`^[0-9a-zA-Z\-\,\.]+$`)
srsRE, srsErr = regexp.Compile(`^EPSG:[0-9]+$`)
withinRE, withinErr = regexp.Compile(`^POLYGON\(\([0-9\-\, \.\+]+\)\)$`)
widthRE, widthErr = regexp.Compile(`^[0-9]+$`)
Expand Down
1 change: 1 addition & 0 deletions internal/valid/valid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestQuery(t *testing.T) {
{k: "within", v: "POLYGON((177.18 -37.52,177.19 -37.52,177.20 -37.53,177.18 -37.52))"},

{k: "sites", v: "GISB,CHTI,RAUL"},
{k: "sites", v: "VO.GISB,VO.CHTI,RAUL"},

{k: "width", v: "500"},

Expand Down

0 comments on commit 6579180

Please sign in to comment.