Skip to content

Commit

Permalink
Merge pull request #257 from GeoNet/case-IU-SNZO
Browse files Browse the repository at this point in the history
feat: add IU/SNZO for querie special case
sue-h-gns authored Sep 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents bae9e7e + 2a6eeb9 commit e6a9f45
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
@@ -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

0 comments on commit e6a9f45

Please sign in to comment.