fix: correctly detect format OBSVER1 if there is no header, just data

This is required for OBS compatibility, which drops the header line on
upload.
This commit is contained in:
Paul Bienkowski 2020-11-21 13:15:49 +01:00
parent f8bb6e7ab7
commit 598c6620d7

View file

@ -73,6 +73,13 @@ function detectFormat(body) {
return 1;
}
// If we immediately start with data (a date, formatted as DD.MM.YYYY), then
// we have an old OBS not sending the header. It must therefore be old
// format, too.
if (/^[0-9]{2}\.[0-9]{2}\.[0-9]{4};/.test(firstLine)) {
return 1;
}
return 'invalid';
}