two identical internal calls from different origins, one is redirected other is notRSS

4 replies

Last post Sep 11, 2020 08:40 AM by Jalpa Panchal

  • two identical internal calls from different origins, one is redirected other is not

    Sep 10, 2020 05:02 PM|rickabs|LINK

    I have two identical ajax calls from two different asp.net pages using js.  The request from the new page is being redirected and I can't figure out how or why this is happening.   I pasted the results from the two requests.  am I missing an entry outside of URLRewriter.config that takes into account the request's origin?

    10-Sep-2020 10:48:16.475 - OnBeginRequest - Entry - Absolute Url=http://dev.digitallab.com/DigitalLabCatalogService.aspx/UploadTrace2, Local Path=/DigitalLabCatalogService.aspx/UploadTrace2
    10-Sep-2020 10:48:16.475 - Build=Release, Runtime=v2.0.50727
    10-Sep-2020 10:48:16.475 - OnBeginRequest - Being REDIRECTED to http://dev.digitallab.com/DigitalLabCatalogService.aspx/UploadTrace2/Home.aspx

    when I make the same call from the original page I don't get a redirect.

    10-Sep-2020 10:54:42.178 - OnBeginRequest - Entry - Absolute Url=http://dev.digitallab.com/DigitalLabCatalogService.aspx/UploadTrace2, Local Path=/DigitalLabCatalogService.aspx/UploadTrace2
    10-Sep-2020 10:54:42.178 - Build=Release, Runtime=v2.0.50727

  • Re: two identical internal calls from different origins, one is redirected other is not

    Sep 10, 2020 09:33 PM|lextm|LINK

    rickabs

    URLRewriter.config

    That does not sound like IIS's URL Rewrite module, so you'd better dig first what redirection mechanism is in use. This forum only covers IIS URL Rewrite module.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: two identical internal calls from different origins, one is redirected other is not

    Sep 10, 2020 09:49 PM|rickabs|LINK

    Appreciate you replying to the post, I should of included the response headers.  The second call looks exactly the same but ir stops at 10. The previous log entries were from the rewriter trace.  Any help is greatly appreciated.

    1. Response Headers
      view source
      1. Access-Control-Allow-Credentials:
        true
      2. Access-Control-Allow-Headers:
        http://dev.digitallab.com
      3. Access-Control-Allow-Methods:
        GET, PUT, POST, DELETE, HEAD, OPTIONS, PATCH
      4. Access-Control-Allow-Origin:
        http://dev.digitallab.com
      5. Access-Control-Expose-Headers:
        http://dev.digitaleab.com
      6. Content-Length:
        0
      7. Date:
        Thu, 10 Sep 2020 15:44:41 GMT
      8. Location:
        http://dev.digitallab.com/DigitalLabCatalogService.aspx/GetRules/Home.aspx
      9. Server:
        Microsoft-IIS/10.0
      10. X-Powered-By:
        ASP.NET
      11. X-Redirected-By:
        nUrlRewriter
  • Re: two identical internal calls from different origins, one is redirected other is not

    Sep 10, 2020 11:54 PM|lextm|LINK

    rickabs

    X-Redirected-By:
    nUrlRewriter

    That's a dead CodePlex project, https://archive.codeplex.com/?p=nUrlRewriter and I don't think you should use it any more.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: two identical internal calls from different origins, one is redirected other is not

    Sep 11, 2020 08:40 AM|Jalpa Panchal|LINK

    rickabs

    X-Redirected-By:
    nUrlRewriter

    Instead of using nUrlRewriter use IIS URL rewrite Extention.URL Rewrite allows Web administrators to easily build powerful rules using rewrite providers written in .NET, regular expression pattern matching, and wildcard mapping to examine information in both URLs and other HTTP headers and IIS server variables. Rules can be written to generate URLs that can be easier for users to remember, simple for search engines to index, and allow URLs to follow a consistent and canonical hostname format. URL Rewrite further simplifies the rule creation process with support for content rewriting, rule templates, rewrite maps, rule validation, and import of existing mod_rewrite rules.

    you can download it from the below link:

    https://www.iis.net/downloads/microsoft/url-rewrite

    Creating Rewrite Rules for the URL Rewrite Module

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.