Commit 5254501e authored by nitroxis's avatar nitroxis

Add URL decode for API access.

parent 0f7e20a3
using System;
using System.Diagnostics;
using System.Linq;
using System.Web;
using Microsoft.AspNetCore.Mvc;
using UrlShortener.Models;
......@@ -87,6 +88,7 @@ namespace UrlShortener.Controllers
string longUri = this.HttpContext.Request.QueryString.Value;
if (longUri.StartsWith('?'))
longUri = longUri.Substring(1);
longUri = HttpUtility.UrlDecode(longUri);
string shortUri = this.shorten(longUri, out string error);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment