question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

redirectURL is not matching location response header

See original GitHub issue

According to http://www.softwareishard.com/blog/har-12-spec/

redirectURL [string] - Redirection target URL from the Location response header.

Example:

$ curl http://github.com/ -I
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https://github.com/
Connection: close

$ chrome-har-capturer http://github.com/
...
               "request": {
                    "method": "GET",
                    "url": "http://github.com/",
                    "httpVersion": "http/1.1",
                    "cookies": [],
                    "headers": [
                        {
                            "name": "Upgrade-Insecure-Requests",
                            "value": "1"
                        },
                        {
                            "name": "User-Agent",
                            "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36"
                        }
                    ],
                    "queryString": [],
                    "headersSize": 178,
                    "bodySize": -1
                },
                "response": {
                    "status": 307,
                    "statusText": "Internal Redirect",
                    "httpVersion": "http/1.1",
                    "cookies": [],
                    "headers": [
                        {
                            "name": "Location",
                            "value": "https://github.com/"
                        },
                        {
                            "name": "Non-Authoritative-Reason",
                            "value": "HSTS"
                        }
                    ],
                    "redirectURL": "",
                    "headersSize": 97,
                    "bodySize": 0,
                    "_transferSize": 97,
                    "content": {
                        "size": 0,
                        "mimeType": "",
                        "compression": 0
                    }
                },
...

From Chrome (Save as HAR):
...
        "request": {
          "method": "GET",
          "url": "http://github.com/",
          "httpVersion": "unknown",
          "headers": [
            {
              "name": "Upgrade-Insecure-Requests",
              "value": "1"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.44 Safari/537.36"
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 307,
          "statusText": "Internal Redirect",
          "httpVersion": "unknown",
          "headers": [
            {
              "name": "Location",
              "value": "https://github.com/"
            },
            {
              "name": "Non-Authoritative-Reason",
              "value": "Delegate"
            }
          ],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "x-unknown"
          },
          "redirectURL": "https://github.com/",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0
        },
...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cyrus-andcommented, Nov 18, 2016

It should work now, I thought headers were normalised by Chrome.

1reaction
cyrus-andcommented, Nov 18, 2016

I thought I did this… Done! Thanks for the reminder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Location - HTTP - MDN Web Docs - Mozilla
The Location response header indicates the URL to redirect a page to. It only provides a meaning when served with a 3xx (redirection)...
Read more >
How to get the location header in Google Apps Script
You need to use fetch(url, params) method of UrlFetchApp class and supply followRedirects parameter set to false : var response = UrlFetchApp.fetch(tURL, ...
Read more >
Modifying HTTP Response Headers | Microsoft Learn
For example when an application behind a reverse proxy returns a redirect response, the HTTP Location header in the response may not ......
Read more >
Redirect URL, Modify Headers & Mock APIs
Web Debugging Proxy to Intercept & Modify HTTPs Requests - Redirect URL, Modify Headers, Mock APIs, Modify Response, Insert Scripts.
Read more >
Listeners for your Application Load Balancers
You can specify the names of standard or custom HTTP header fields. The header name and the match evaluation are not case-sensitive.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found