Skip to content

Commit 2f89e1b

Browse files
fix human_link in OSV export
Repo re-re-org (to un-break OSV export) broke the human_link in the exported OSV. This commit fixes it.
1 parent d3c23dd commit 2f89e1b

File tree

1 file changed

+11
-2
lines changed
  • code/hsec-tools/src/Security/Advisories/Convert

1 file changed

+11
-2
lines changed

code/hsec-tools/src/Security/Advisories/Convert/OSV.hs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,20 @@ mkAffectedWithLinks links hsecId aff =
114114
{ OSV.affectedDatabaseSpecific =
115115
Just
116116
AffectedLinks
117-
{ affectedLinksOSV = stripSlash (dbLinksOSVs links) <> "/" <> T.pack (show $ hsecIdYear hsecId) <> "/" <> T.pack (printHsecId hsecId) <> ".json"
118-
, affectedLinksHumanLink = stripSlash (dbLinksHome links) <> "/tree/main/advisories/published/" <> T.pack (show $ hsecIdYear hsecId) <> "/" <> T.pack (show $ hsecIdSerial hsecId) <> ".md"
117+
{ affectedLinksOSV = osvLink
118+
, affectedLinksHumanLink = humanLink
119119
}
120120
, ..
121121
}
122122
where
123123
OSV.Affected{..} = mkAffected aff
124124
stripSlash = T.dropWhileEnd (== '/')
125+
osvLink =
126+
stripSlash (dbLinksOSVs links)
127+
<> "/" <> T.pack (show $ hsecIdYear hsecId)
128+
<> "/" <> T.pack (printHsecId hsecId) <> ".json"
129+
humanLink =
130+
stripSlash (dbLinksHome links)
131+
<> "/tree/main/advisories/published/"
132+
<> T.pack (show $ hsecIdYear hsecId)
133+
<> "/" <> T.pack (printHsecId hsecId) <> ".md"

0 commit comments

Comments
 (0)