Check dynamic web page is modified - http

I want to check if page https://m.nn.ru/f/1238 has been updated periodically.
I ran
curl https://m.nn.ru/f/1238 | head -c 4096
And it's output is below:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="1;url=https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238" />
<title>Redirecting to https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238</title>
</head>
<body>
Redirecting to https://passport.ngs.ru/check/?name=ngs_token&return=http%3A%2F%2Fm.nn.ru%2Ff%2F1238.
</body>
</html>
So I am redirected to login page and brought back to m.nn.ru/f/1238
When I open m.nn.ru/f/1238 in browser it doesn't show the redirection link but the contents of m.nn.ru/f/1238 (though I am not logged in and I think there are no cookies set)
How to get the contents of https://m.nn.ru/f/1238 ?
Another alternative is to use https://nn.ru/community/hobby/advance which has a 301 redirect

I found a workaround. I installed elinks text-mode browser and save the page:
elinks https://m.nn.ru/f/1238 > 1

Related

Redirect request to persist POST method? (cXML)

I have integration that uses cXML standard, where customer connects from his own system, to our system, to buy goods and then to be redirected back to his own system, with all those goods created in his system.
We already implemented this to work between Odoo and Ariba/SAP, but its not working properly with Dynamics 365. Problem happens on final step, when user needs to be redirected back to his system to end his purchase.
Every time it is redirected, it looks like it converts POST request to get and then gives this as a result:
From requests, it looks like it starts fine with a POST (and 308 redirect to persist that), but then it becomes GET.
So I am not sure if its Dynamics 365 doing that or maybe I am missing something to make it work properly? It also loooks like it triggers login to Dynamics (even though that user is already logged in).
I tried various ways to finish this step, but in all cases it ends up the same:
I tried simple submit with HTML/JS to see if maybe my implementation is doing something wrong:
<form id="cxml_form" method="POST" action="https://some-subdomain.dynamics.com/punchout/cxml/COOKIE" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="cXML-urlencoded" value='payloadPlaceholder'>
</form>
<script type="text/javascript">document.getElementById('cxml_form').submit()</script>
Basically same thing.
Also tried to do it with flask:
#app.route('/cxml', methods=['POST'])
def send_cxml():
return redirect(
"https://some-subdomain.dynamics.com/punchout/cxml/COOKIE",
308,
)
There is also this site to test CXML: https://punchoutcommerce.com/tools/cxml-order-tester
So using that, it receives response something like this:
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html dir="ltr" class="" lang="en">
<head>
<title>Sign in to your account</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link rel="preconnect" href="https://aadcdn.msauth.net" crossorigin>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//aadcdn.msauth.net">
<link rel="dns-prefetch" href="//aadcdn.msftauth.net">
...
...
It looks like it just tries to redirect to login page (even though I am logged in to dynamics)?

Google One Tap UI Not Showing

I am trying to show Google One Tap UI on a barebone template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://accounts.google.com/gsi/client" async defer></script>
</head>
<body>
<div id="g_id_onload"
data-client_id="00000-xx000rrr.apps.googleusercontent.com"
data-context="signin"
data-login_uri="https://example.com/login/"
data-auto_select="true">
</div>
</body>
</html>
It showing nothing! I tried on incognito, configured oauth consent screen and whitelisted the localhost domain (with ssl).
What am I missing here?
As is this will automatically log in a user that has given consent to your app. If anything you'll see a popup that says signing in.
What you need is to include the HTML for the button to show up. Like this
<div class="g_id_signin"
data-type="standard"
data-shape="rectangular"
data-theme="outline"
data-text="signin_with"
data-size="large"
data-logo_alignment="left">
</div>
Also it won't work at all over http, the site has to be https.
you can check here for a generator
https://developers.google.com/identity/gsi/web/tools/configurator
As a simple first test, you might try using a callback and console.log() to output the credential. Then add your back-end server into the mix once you're happy with the UI and confirm your understanding of the sign-in flow.
Incognito mode is the best way to ensure you've not accidentally triggered the exponential cooldown timer.
Visit https://myaccount.google.com/security, Signing in to other sites to find your app, revoke it's permissions to reset the sign-in flow, and to confirm the global opt-out is enabled.
Removing data-auto_select will display the One Tap popup, including it will instead show the automatic sign-in prompt on return visits.

Redirect index.html to index.php WordPress

Sorry, this might be stupid question but I just can't get it to work.
I have a WordPress installation under the main domain which works perfectly. Additionally I have a second domain which points to the same webroot but requests an index.html instead of the default index.php. I tried pretty much everything I could find online but nothing seems to work. Editing the .htaccess did not work and when I try to create an index.html with a redirect like so
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://mainDomain.com/index.php">
<script type="text/javascript">
window.location.href = "http://mainDomain.com/index.php"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow the <a href='http://mainDomain.com'>link to example</a>
</body>
</html>
WordPress always calls the index.html instead of the index.php and I have an infinite loop.
Can anyone help please?

How to Properly Setup an Exit/Panic Button with Multiple Redirects

I have a site that that I've built that is for a Women's Shelter, and it requires the 'exit button' or 'panic button'.. many sites just exit you to Google or another friendly site.. I see a few questions on here that solve the problem in one way or another, but this one my client is most interested in:
http://www.ncadv.org/
Can someone tell me how they're doing this? When you click on the 'safety exit' button, it redirects a BUNCH of times to different sites (thus filling the history quickly with other friendly sites).. I really like this approach, I just can't figure how they're doing it. Any ideas? I'd thought originally they were directing to sites that have their own redirect pages set up, but if you copy the initial link in a new window, it only redirects one time.
Probably via HTTP Referer. To test, run the following in command line:
curl --header "Referer: http://www.ncadv.org/" http://abconlinenews.info/localnews.php
The link, http://abconlinenews.info/localnews.php is the first outgoing link on the button.
The response (when passed an HTTP referer with ncadv.org) is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>ABCNews.com: Daily News, Breaking News and Video Broadcasts - ABC News</title>
<script>
function trigger() {
setTimeout("setPage();",20);
}
function setPage() {
window.location="/localnewstoday.php";
}
</script>
</head>
<body onload="trigger();">
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at http://abconlinenews.info Port 80</address>
</body>
</html>
From there, it's probably referers and redirects all the way down ;)
One thing you might consider is using javascript to keep the history clear. If you use "location.replace('www.google.com');" for example, it will replace the current entry with the new url and there won't be a history entry to go back to.
If you used a function and passed urls to it via onClick events, you could eliminate any history from being tracked at all.

Favicon not working on my login page

I have a favicon on my website. It does not show up when i go to my login page, but works perfectly after logging in. I am using forms authentication on my website.
If the favicon is in your root directory, most browsers should display it automatically.
I visited the page and did not receive a favicon (as you suggested) but checked the source and noticed you do not link to the favicon explicitly. Try to add a line similar to the following in your own <head> section:
<link href='corbyhaas/favicon.ico' type='image/png' rel='icon' />
For more information, check out w3's How To Favicon.
Edit: This is the source I see for the head tag in your login page.
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="Styles/masterstyle.css" />
<title>OnCall APP_ADMIN</title>
</head>
Obviously you're including the necessary information in the rest of your application; just do the same thing in whatever builds the <head> tag on the login page.

Resources