Merge pull request #18 from harvard-lil/post-0.0.3-fixes

Post 0.0.3 launch fixes
pull/20/head 0.0.3
Matteo Cargnelutti 2022-11-29 16:48:16 -05:00 zatwierdzone przez GitHub
commit 60a6c62956
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -70,7 +70,7 @@ export class SuccessLog {
* - Updates `this.#hashes` (so it doesn't need to reload from file)
*
* @param {string} identifier - Can be an IP or access key
* @param {string} why - Reason for creating this archive
* @param {string} why - Reason for creating this archive (500 chars max).
* @param {Buffer} pdfBytes - Used to store a SHA512 hash of the PDF that was delivered
*/
add(identifier, why, pdfBytes) {
@ -86,6 +86,8 @@ export class SuccessLog {
.replaceAll("{", "")
.replaceAll("}", "");
why = why.substring(0, 500);
// Save entry
const entry = `${new Date().toISOString()}\t${identifier}\t${why}\tsha512-${hash}\n`;
fs.appendFileSync(SuccessLog.filepath, entry);

Wyświetl plik

@ -53,7 +53,7 @@ Calculates hash of a PDF an:
| Param | Type | Description |
| --- | --- | --- |
| identifier | <code>string</code> | Can be an IP or access key |
| why | <code>string</code> | Reason for creating this archive |
| why | <code>string</code> | Reason for creating this archive (500 chars max). |
| pdfBytes | <code>Buffer</code> | Used to store a SHA512 hash of the PDF that was delivered |
<a name="utils.module_SuccessLog.SuccessLog+findHashInLogs"></a>