Skip to content

Commit 38d4d1a

Browse files
committed
Add FIXME comment to Etag function
We are not using etag correctly. Also the function name is misleading as we are checking the Etag in this create_etag function Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 8350f6c commit 38d4d1a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

vulnerabilities/helpers.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import json
2424
import re
2525

26-
import yaml
2726
import requests
2827
import toml
28+
import yaml
2929

3030

3131
def load_yaml(path):
@@ -43,6 +43,13 @@ def load_toml(path):
4343
return toml.load(f)
4444

4545

46+
# FIXME: this is NOT how etags work .
47+
# We should instead send the proper HTTP header
48+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match
49+
# and integrate this finely in the processing as this typically needs to use
50+
# streaming=True requests, and proper handling of the HTTP return code
51+
# In all cases this ends up being a single request, not a HEADD followed
52+
# by another real request
4653
def create_etag(data_src, url, etag_key):
4754
"""
4855
Etags are like hashes of web responses. For a data source `data_src`,

0 commit comments

Comments
 (0)