Skip to content

Commit

Permalink
Fixed comments and application/json
Browse files Browse the repository at this point in the history
  • Loading branch information
Kretchen001 committed Apr 8, 2024
1 parent 7b021be commit ff51a96
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/AmIVulnerable/AmIVulnerable/Controllers/DbController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public IActionResult ConvertRawFilesToMySql() {
}
}

/// <summary></summary>
/// <summary>Update the Database, if it exists already.</summary>
/// <returns></returns>
[HttpPost]
[Route("Update")]
Expand All @@ -149,7 +149,7 @@ public IActionResult UpdateCveDatabase() {
connection.Close();

if (count == 0) {
return BadRequest("Table not exist!\nPlease download the cve and create a database before try to update it.");
return BadRequest("Table does not exist!\nPlease download cve data and create the database before trying to update it over the route for that!");
}

//start update process
Expand Down Expand Up @@ -252,7 +252,7 @@ public IActionResult UpdateCveDatabase() {
}
}

/// <summary></summary>
/// <summary>Return the full text of a cve, when it is requested.</summary>
/// <param name="cve_number"></param>
/// <returns></returns>
[HttpGet]
Expand Down Expand Up @@ -280,7 +280,9 @@ public IActionResult GetFullTextCve([FromHeader] string? cve_number) {
return NoContent();
}

return Ok(JsonConvert.SerializeObject(resDataTable.Rows[0]["full_text"].ToString()));
CVEcomp? cVEcomp = JsonConvert.DeserializeObject<CVEcomp>(resDataTable.Rows[0]["full_text"].ToString()!);

return Ok(cVEcomp);
}
catch (Exception ex) {
return BadRequest(ex.StackTrace + "\n\n" + ex.Message);
Expand Down

0 comments on commit ff51a96

Please sign in to comment.