How to use scripts on relay response url? - css

I'm trying to style my relay response URL for A.Net, but the URL is still showing "https://test.authorize.net/gateway/transact.dll" so my CSS files are not being included. Right now it just looks like an ugly plain HTML page.
Do I have to pass along the response code and other POST information to another script on my server in order to include the styling?

Relay Response loads your page as a pass-through (Authnet reads the contents of your page and sends them to the user). This means if you must either use the full URL (e.g. including the protocol and domain name) in the path to your CSS file or put the CSS directly in the web page.

Related

Proxy HTTP requests while modify their bodies

Image this scenario:
You have a web server that serves static frontend files. For example, www.google.com.
You can not access and modify those files (can't change CSS, can't change HTML, etc.)
However, you want to re-style the web page using CSS. For example, restyle how www.google.com looks like.
You would set up a proxy server to pass requests and responses. Responses would be read and modified by the proxy server before passing back. For example, adding custom CSS.
The whole diagram would look something like this:
And before someone accuses me of trying to hack someone, I am simply trying to go around a limitation of AWS Cognito built-in login-page limitations. For example, you can not change the background of the web page.

Webalizer not picking up on server-side redirects

I'm using Webalizer on an intranet, and I want statistics for clicks on outbound links. I set up the links to point to a simple ASP redirection page -
each link resembles "redirect.asp?url=http://outsidesite.com". But Webalizer is not tracking the redirections. Is there a setting in the Webalizer config file that needs to be changed? Or do I need to set up the redirection differently?
I found a solution - I used a META refresh in my ASP page instead of a server-side redirect. The server-side code puts the query string's URL in the refresh's CONTENT value.

How can I find the URL that downloads a file?

I am developing a web scraper and I need to download a .pdf file from a page. I can get the file name from the html tag, but can't find the complete url (or request body) that downloads the file.
I have tried to sniff the traffic with the chrome and firefox network traffic tool and with wireshark, with no success. I can see it make a post request to the exact same url as the page itself, and so I can't understand why this happens. My guess is that the filename is being sent inside the POST request body, but I also can't find that information in those tools. If I could see the variable name in the body, I could create a copy of the request and then get the file.
How can I get that information?
Here is the website I am talking about: http://www2.trt8.jus.br/consultaprocesso/formulario/ProcessoConjulgado.aspx?sDsTelaOrigem=ListarProcessos.aspx&iNrInstancia=1&sFlTipo=T&iNrProcessoVaraUnica=126&iNrProcessoUnica=1267&iNrProcessoAnoUnica=2010&iNrRegiaoUnica=8&iNrJusticaUnica=5&iNrDigitoUnica=24&iNrProcesso=1267&iNrProcessoAno=2010&iNrProcesso2a=0&iNrProcessoAno2a=0
EDIT: for those seeking to do something similar, take a look at this website: http://curl.trillworks.com/
It converts a cURL to a python requests code. Very useful
The POST data used for the request is encoded content generated by ASP.NET. It contains various state/session information of the page that the link is on. This makes it difficult to directly scrape for the URL.
You can examine the HAR by exporting it from the Network tab in Chrome DevTools:
The __EVENTVALIDATION data is used to ensure events raised on the client originate from the controls rendered on the page from the server.
You might be able to achieve what you want by requesting the page the link is on first, then extract the required POST data from the response (containing the page state and embedded request for file), and then make a new request with this information. This assumes the server doesn't expire any sessions in the meantime.

Form Data Not Posting While Using URL Rewrite

OK. Where to start....
I have a website. It is running on an IIS server using classic asp. I have forms on that website.
The forms were working fine until I decided to add some url rewrite rules to my web.config file to redirect nice looking urls.
After doing that, the form on my website does not post the data. It is going to the correct address, but nothing is passing to the page that is suppose to do the processing. On the page that I am processing if I do this:
For each FieldName in Request.Form
Response.write FieldName & " = " & Request.Form(FieldName) & "<br>"
Next
I get absolutely nothing. No form field names or values.
What do I need to add to the web.config file so that the data will post? And... more importantly... Where do I need to add it at in my web.config file?
Here is a text copy of my web.config file http://elvis-is-alive.com/webconfig.txt
Your web.config contains action=redirect.
A redirect always results redirect header being sent to the browser. This changes the URL in the browser address bar, and the browser then issues an HTTP GET for the new address. With an HTTP GET, no form/post data are ever sent; all arguments are assumed to be in the URL querystring.
If you'd like to avoid the redirect and use a true rewrite, change your web.config to use action=rewrite. Using this method, no redirect header is sent back to the browser, the browser address bar never changes, and IIS simply redirects the current request stream to a different location.
Something tells me that's not what you want-- you want the address bar in the browser to change and you want the form/post data to be preserved. This is not possible unless you do something very unusual, e.g. render a temporary interstitial page containing the original form/post request with an action pointing at the new URL. I don't recommend doing this.
Why not just change the form action in the original page's HTML?

QueryString in domnio xpages or not, not normalized

I'm trying to adapt an application with domino xpages. The html request send by client are like http://www.someserver.org/someapplication.nsf/someresource.png?v=2.3.4 or http://www.someserver.org/someapplication.nsf/somerresource.swf?x=27421, that are not standard domino url query string.
Anybody know, how I have to implement this response in the server side?
To get access to the query string you need to have an XPage (with content or without content as XAgent), so you can get access to the querystring. For your example you could use a Internet site rule to actually redirect the content to:
http://www.someserver.org/someapplication.nsf/resourcepage.xsp?file=somerresource.swf&x=27421
The rest should be easy

Resources