Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule to avoid HTTP redirects #641

Closed
molant opened this issue Nov 9, 2017 · 3 comments
Closed

Add rule to avoid HTTP redirects #641

molant opened this issue Nov 9, 2017 · 3 comments

Comments

@molant
Copy link
Member

molant commented Nov 9, 2017

This is part of #438 and more specifically #438 (comment)

I'm starting with this rule (at least the basic redirects). These are my initial thoughts:

  • Allow the user to configure the number of hops, by default 0
  • Try to add information about time spent on dns lookup, redirects, etc. I believe we've already added that information to request and it might be a good opportunity to get @axemclion work on New: Added Chrome Traces to cdp connector #420 merged somehow. This part of the rule's should be conditional, some connectors might not have it (like the edge15 one)

Main question: What do we do about the main page? Some websites have friendly urls. E.g.: https://edge.ms --> https://developer.Microsoft.com/en-us/microsoft-edge/
I think we should add another property for the number of hops for the sourceTarget that will be 0 by default in the CLI but maybe 1-2 in the online-scanner.

@alrra
Copy link
Contributor

alrra commented Nov 10, 2017

Main question: What do we do about the main page? Some websites have friendly urls. E.g.: https://edge.ms --> https://developer.Microsoft.com/en-us/microsoft-edge/
I think we should add another property for the number of hops for the sourceTarget that will be 0 by default in the CLI but maybe 1-2 in the online-scanner.

Personally, in that example, I don't see https://edge.ms as the "main" page, just as an alternative (short) URL.

Maybe allow URL/pattern related configs similar to what we do with ignoredUrls?

@molant
Copy link
Member Author

molant commented Nov 10, 2017

I don't see https://edge.ms as the "main" page

Then what about https://dev.microsoftedge.com ?
That's the url used everywhere. It is still going to redirect to the long one.

Maybe allow URL/pattern related configs

How would that work? I still prefer having separate redirect options for target and resource but happy to explore other options..

@alrra
Copy link
Contributor

alrra commented Nov 10, 2017

Then what about https://dev.microsoftedge.com ?

I see it the same as with https://edge.ms , it's a shorter version of the final URL.

An example where I personally don't see it like that is:

https://www.microsoft.com/ => https://www.microsoft.com/en-us/ or https://www.microsoft.com/ro-ro/

How would that work?

Same as for other rules.

"no-http-redirects": [ "warning", {  
   ".*\\.js": 3
}]

@alrra alrra closed this as completed in b662689 Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants