VB.NET 2.0: Where did the url come from?

I need to debug the old VB.NET 2.0 code of someone who left the company. We have a production system (let's call it http: // prod ) and a test system ( http: // test ). Both are almost similar, including the document repository. When looking at documents in production, all the hyperlinks showing at the bottom are all right (that is, they say something like http: //prod/download.ashx? Id = {GUID}).

However, in the test it is the same thing ( http: //prod/download.ashx? Id = {GUID}), even it should be http: //test/download.ashx? Id = {GUID}.

After hours of debugging, I found the corresponding line of code:

html += "<td><a href='" + HttpContext.Current.Request.Url.AbsoluteUri.Replace(HttpContext.Current.Request.Url.PathAndQuery, "/") + "int/download.ashx?id=" + row.Item(0).ToString() + "' target='_blank' class='" + row.Item(3).ToString() + "'>" + row.Item(1).ToString() + "</a>" + privat + "</td><td>" + row.Item(2).ToString() + "</td>"

Looking at html, it shows that

"<table class='table_dataTable'><thead><tr><td>Name</td><td>Jahr</td></tr></thead><tbody><tr><td><a href='http://prod/int/download.ashx?id=4d280886-db88-4b25-98d8-cf95a685d4a4' target='_blank' class='doc'>Document for managers</a></td><td>2014</td>"

So, I wonder where it comes from due to the wrong? I may have found the appropriate piece of code, but I'm not sure what to do now, respectively, if I am right about it?

Public Class download : Implements IHttpHandler, IReadOnlySessionState
    Dim debug As String = ""
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Dim fehler As String = ""
        Try
            ' Get the file name from the query string
            Dim queryFile As String = context.Request.QueryString("id")
            debug += "id=" + queryFile + "<br>"

Any help is appreciated since VB.NET is not my primary concern.

+4
source share
1 answer

You have probably checked this, but sometimes the obvious is skipped.

  • Check the URL in the browser window. Make sure it has not changed to http: // prod ... while you were moving forward.

  • , - . URL- prod. , web.config , , , .

  • URL IIS -

0

Source: https://habr.com/ru/post/1614167/


All Articles