Skip to content

Commit 1c64261

Browse files
committed
fixup: use md5
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 6e3a55b commit 1c64261

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/reference/flagd-ofrep.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags'
2525

2626
## HTTP Caching
2727

28-
The bulk evaluation endpoint supports HTTP caching via ETags (SHA1-based). Clients can use the `If-None-Match` header with a previously received `ETag` to validate cached responses. When the response hasn't changed, the server returns `304 Not Modified` without a body, reducing bandwidth.
28+
The bulk evaluation endpoint supports HTTP caching via ETags (MD5-based). Clients can use the `If-None-Match` header with a previously received `ETag` to validate cached responses. When the response hasn't changed, the server returns `304 Not Modified` without a body, reducing bandwidth.
2929

3030
```shell
3131
curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags' \

flagd/pkg/service/flag-evaluation/ofrep/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ofrep
22

33
import (
44
"context"
5-
"crypto/sha1"
5+
"crypto/md5"
66
"encoding/json"
77
"fmt"
88
"net/http"
@@ -194,7 +194,7 @@ func calculateETag(response ofrep.BulkEvaluationResponse) (string, []byte, error
194194
return "", nil, fmt.Errorf("failed to marshal response for ETag calculation: %w", err)
195195
}
196196

197-
hash := sha1.Sum(data)
197+
hash := md5.Sum(data)
198198
return fmt.Sprintf("\"%x\"", hash), data, nil
199199
}
200200

0 commit comments

Comments
 (0)