Skip to content

Commit

Permalink
feat: add IU/SNZO for querie special case
Browse files Browse the repository at this point in the history
  • Loading branch information
junghao committed Sep 3, 2024
1 parent bae9e7e commit 2a6eeb9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/fdsn-ws/fdsn_dataselect.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,12 @@ func fdsnDataselectV1Handler(r *http.Request, w http.ResponseWriter) (int64, err
if !d.End.After(d.Start) {
return 0, fdsnError{StatusError: weft.StatusError{Code: http.StatusBadRequest, Err: fmt.Errorf("endtime must be after starttime")}, url: r.URL.String(), timestamp: tm}
}
// we only do "NZ"
if m, err := regexp.MatchString(d.Network, "NZ"); err != nil || !m {
continue
// We reject all queries for network not "NZ", except special case IU/SNZO.
// Note: IU/SNZO won't matched by wildcard queries.
if d.Network != "IU" && d.Station != "SNZO" {
if m, err := regexp.MatchString(d.Network, "NZ"); err != nil || !m {
continue
}
}
// only run query when the pattern contains only uppercase alphabetic, numbers, wildcard chars
// if the pattern string is out of this range, we knew it won't produce results
Expand Down

0 comments on commit 2a6eeb9

Please sign in to comment.