Skip to content

Commit f4a5ecc

Browse files
Fixed code scanning reports.
1 parent 12b8a9f commit f4a5ecc

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/NumberSearch.Ingest/bin/
1313
/NumberSearch.Ingest/obj
1414
/NumberSearch.DataAccess/bin/
15-
/NumberSearch.Mvc/bin
15+
/NumberSearch.Mvc/bin/
1616
/NumberSearch.Mvc/.config
1717
/NumberSearch.Mvc/Properties/PublishProfiles
1818
/NumberSearch.Tests/bin/
@@ -46,3 +46,5 @@
4646
/Messaging.Tests/bin/Release/net9.0
4747
/Messaging.Tests/bin/Debug/net10.0
4848
*.gif
49+
*/bin/
50+
*/obj/

NumberSearch.Mvc/Controllers/CartAPIController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ await Parallel.ForEachAsync(parsedNumbers, async (number, token) =>
108108

109109
[ApiExplorerSettings(IgnoreApi = true)]
110110
[HttpPost("Add/NewClient/{id}/ExtensionRegistration")]
111+
[ValidateAntiForgeryToken]
111112
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
112113
public async Task<IActionResult> AddNewClientExtensionRegistrationAsync([FromRoute] Guid id, [FromBody] ExtensionRegistration registration)
113114
{
@@ -177,6 +178,7 @@ public async Task<IActionResult> RemoveNewClientExtensionRegistrationAsync([From
177178

178179
[ApiExplorerSettings(IgnoreApi = true)]
179180
[HttpPost("Add/NewClient/{id}/NumberDescription")]
181+
[ValidateAntiForgeryToken]
180182
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
181183
public async Task<IActionResult> AddNewClientNumberDescriptionAsync([FromRoute] Guid id, [FromBody] NumberDescription description)
182184
{
@@ -247,6 +249,7 @@ public async Task<IActionResult> RemoveNewClientNumberDescriptionAsync([FromRout
247249

248250
[ApiExplorerSettings(IgnoreApi = true)]
249251
[HttpPost("Add/NewClient/{id}/IntercomRegistration")]
252+
[ValidateAntiForgeryToken]
250253
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
251254
public async Task<IActionResult> AddNewClientIntercomRegistrationAsync([FromRoute] Guid id, [FromBody] IntercomRegistration description)
252255
{
@@ -317,6 +320,7 @@ public async Task<IActionResult> RemoveNewClientIntercomRegistrationAsync([FromR
317320

318321
[ApiExplorerSettings(IgnoreApi = true)]
319322
[HttpPost("Add/NewClient/{id}/SpeedDialKey")]
323+
[ValidateAntiForgeryToken]
320324
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
321325
public async Task<IActionResult> AddNewClientSpeedDialKeyAsync([FromRoute] Guid id, [FromBody] SpeedDialKey description)
322326
{
@@ -385,6 +389,7 @@ public async Task<IActionResult> RemoveNewClientSpeedDialKeyAsync([FromRoute] Gu
385389

386390
[ApiExplorerSettings(IgnoreApi = true)]
387391
[HttpPost("Add/NewClient/{id}/FollowMeRegistration")]
392+
[ValidateAntiForgeryToken]
388393
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
389394
public async Task<IActionResult> AddNewClientFollowMeRegistrationAsync([FromRoute] Guid id, [FromBody] FollowMeRegistration description)
390395
{
@@ -453,6 +458,7 @@ public async Task<IActionResult> RemoveNewClientFollowMeRegistrationAsync([FromR
453458

454459
[ApiExplorerSettings(IgnoreApi = true)]
455460
[HttpPost("Add/NewClient/{id}/PhoneMenuOption")]
461+
[ValidateAntiForgeryToken]
456462
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
457463
public async Task<IActionResult> AddNewClientPhoneMenuOptionAsync([FromRoute] Guid id, [FromBody] PhoneMenuOption option)
458464
{

NumberSearch.Mvc/Controllers/CartController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public static InstallationProductItems GetInstallTimes(ref Cart cart, ref Produc
207207
// Show orders that have already been submitted.
208208
[HttpGet("Cart/Order/{Id}")]
209209
[HttpPost("Cart/Order/{Id}")]
210+
[ValidateAntiForgeryToken]
210211
public async Task<IActionResult> ExistingOrderAsync(Guid Id, bool? AddPortingInfo)
211212
{
212213
if (Id != Guid.Empty)

NumberSearch.Mvc/Views/Porting/Index.cshtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
</div>
3838
</form>
3939
</div>
40-
41-
42-
4340
<div class="row">
4441

4542
@{

0 commit comments

Comments
 (0)