Open himynamesdave opened 3 weeks ago
I see the change, and in the code looks like it should work, but
curl -X 'GET' \
'http://127.0.0.1:8000/api/taxii2/cti_database/collections/mitre_attack_enterprise/objects/?limit=10&match%5Btype%5D=attack-pattern' \
-H 'accept: application/json' \
-H 'Authorization: Basic
Response header
access-control-allow-origin: *
allow: GET,POST,HEAD,OPTIONS
connection: close
content-length: 31516
content-type: application/taxii+json;version=2.1
cross-origin-opener-policy: same-origin
date: Thu,06 Jun 2024 12:10:35 GMT
referrer-policy: same-origin
server: gunicorn
vary: Accept,origin
x-content-type-options: nosniff
x-frame-options: DENY
x-taxii-date-added-first: 2014-06-23T00:00:00.000Z
x-taxii-date-added-last: 2020-09-17T18:25:33.796Z
but highest modified time in response is "modified": "2024-01-01T00:00:00.000Z"
Coincidentally I do see a modified
time in the response that matches 2020-09-17T18:25:33.796
should be fixed now
now working correctly for
However i Have realised for
the response is slightly different
{
"more": true,
"next": "46833320_undef+0.30489662317927557",
"objects": [
{
"date_added": "2017-01-20T00:00:00.000Z",
"id": "marking-definition--34098fce-860f-48ae-8e50-ebd3cc5e41da",
"media_type": "application/stix+json;version=2.1",
"version": "2017-01-20T00:00:00.000Z"
},
{
"date_added": "2017-01-20T00:00:00.000Z",
"id": "marking-definition--5e57c739-391a-4eb3-b6be-7d15ca92d5ed",
"media_type": "application/stix+json;version=2.1",
"version": "2017-01-20T00:00:00.000Z"
},
For this endpoint the x-taxii-date-added-first and x-taxii-date-added-last should be highest and lowest version
value
Fixed
I noticed an issue with this approach, because some object don't have modified
time
If no modified
time in the object, then the _record_modified
time should be used.
For all objects with a modified
time, this value should always be used
The header shows
x-taxii-date-added-first
is correct. This should be the lowestcreated
time of object in pageHOWEVER
x-taxii-date-added-last
is incorrect. This is currently highestcreated
time of object in page. It should show highestmodified
time of object on page.