diff --git a/Controllers/DashboardController.cs b/Controllers/DashboardController.cs
new file mode 100644
index 0000000..009ec34
--- /dev/null
+++ b/Controllers/DashboardController.cs
@@ -0,0 +1,119 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace WebApp_AppService.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class DashboardController : ControllerBase
+ {
+ ///
+ /// Extracts a critical segment from User-Agent string with proper bounds checking
+ /// to prevent IndexOutOfRangeException
+ ///
+ /// The User-Agent string to parse
+ /// Critical segment or a safe default value
+ private string ExtractCriticalSegment(string? userAgent)
+ {
+ // Defensive check: Handle null or empty User-Agent
+ if (string.IsNullOrWhiteSpace(userAgent))
+ {
+ return "Unknown";
+ }
+
+ try
+ {
+ // Split by common delimiters in User-Agent strings
+ var segments = userAgent.Split(new[] { ' ', '/', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
+
+ // Bounds check: Ensure we have at least one segment
+ if (segments.Length == 0)
+ {
+ return "Unknown";
+ }
+
+ // Safely access the first segment
+ var criticalSegment = segments[0];
+
+ // Additional validation: Ensure the segment is not empty after trim
+ criticalSegment = criticalSegment.Trim();
+ if (string.IsNullOrEmpty(criticalSegment))
+ {
+ return "Unknown";
+ }
+
+ // Limit the length to prevent potential buffer issues
+ const int maxLength = 100;
+ if (criticalSegment.Length > maxLength)
+ {
+ criticalSegment = criticalSegment.Substring(0, maxLength);
+ }
+
+ return criticalSegment;
+ }
+ catch (ArgumentOutOfRangeException)
+ {
+ // Defensive: Handle substring operations that may exceed bounds
+ // This should not occur with current bounds checking but protects against future code changes
+ return "Unknown";
+ }
+ catch (ArgumentException)
+ {
+ // Defensive: Handle string operations that may fail with invalid arguments
+ // This should not occur with current validation but protects against future code changes
+ return "Unknown";
+ }
+ }
+
+ ///
+ /// Admin dashboard endpoint that processes User-Agent information
+ ///
+ /// Dashboard information including parsed User-Agent segment
+ [HttpGet]
+ [Route("admin")]
+ public ActionResult