Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add IU/SNZO for querie special case #257

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading