Skip to content

Conversation

@jmpesp
Copy link
Contributor

@jmpesp jmpesp commented Nov 20, 2018

also write out http_code to avoid using grep to check for 200

also write out http_code to avoid using grep to check for 200
@minicuts minicuts merged commit 898f64b into loggly:master Nov 20, 2018
@OndrejCholeva
Copy link

sorry to say, but unfortunately this is not correct solution:

curl -L -s --head  --request GET invalid23424.loggly.com/login -w '%{http_code}' -o /dev/null

still outputs 200. This is due to invalid subdomain follows redirect to an error page, which surprisingly returns 200 and html code....

@jmpesp
Copy link
Contributor Author

jmpesp commented Nov 20, 2018

@OndrejCholeva @nguyenfilip I originally made this PR because our scripts were failing at this subdomain check step - a 302 is seen because loggly now redirects to another page for auth.

I had no idea that an invalid subdomain redirects to a valid error page! We can use curl's -w again here though, to check that the redirect isn't invalid:

$ curl -Ls -o /dev/null -w %{url_effective} invalid45862456294756239846984918345074562975.loggly.com
https://invalid45862456294756239846984918345074562975.loggly.com/accounts/invalid
$ curl -Ls -o /dev/null -w %{url_effective} testpost.loggly.com
https://my.solarwinds.cloud/login?nonce=S3DECsSQ8rbykxpC&state=eyJvcmlnaW5hdGluZ19vcmdfaWQiOiBudWxsLCAicmZwIjogIjVXY2lxeDAxYWZTaDBrWk4iLCAic3ViZG9tYWluIjogInRlc3Rwb3N0IiwgInJldHVybl9wYXRoIjogIi8ifQ%3D%3D&redirect_uri=https%3A%2F%2Fapp.loggly.com%2Fsso%2Foidc%2Fdo_sign_on&response_type=code&client_id=loggly&scope=openid+swicus

I'll make another PR with this check.

@jmpesp jmpesp deleted the curl_follow_redirects_for_subdomain_check branch November 20, 2018 15:17
@OndrejCholeva
Copy link

@jmpesp #122 covers that already ;-) cheers.

@jmpesp
Copy link
Contributor Author

jmpesp commented Nov 20, 2018

Nevermind, #122 handles it :)

ninja edit: @OndrejCholeva is quicker on the draw :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants