Merge pull request #142 from safing/fix/runtime-sr-provider

Fix runtime single record provider key check
This commit is contained in:
Patrick Pacher 2021-11-15 10:36:05 +01:00 committed by GitHub
commit d717d01197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ func (sr *singleRecordReader) Set(_ record.Record) (record.Record, error) {
// Get implements ValueProvider.Get and returns the wrapped record.Record
// but only if keyOrPrefix exactly matches the records database key.
func (sr *singleRecordReader) Get(keyOrPrefix string) ([]record.Record, error) {
if keyOrPrefix != sr.Record.Key() {
if keyOrPrefix != sr.Record.DatabaseKey() {
return nil, nil
}
return []record.Record{sr.Record}, nil