I have a CF application, let's call it aaa.com. It has a function: aaa.com/file.cfm. I need file.cfm to be called in an other application, let's call it bbb.com.
Within file.cfm I would like to check, where the call is coming from. I tried to get the IP with
CGI.REMOTE_ADDR
But this is giving me the user's IP address. How can I verify that the call is coming from bbb.com? Is there a better way?
All, that bbb.com gets is the link aaa.com/file.cfm
Related
I have a rest web service built with the Visual Studio wizard with a method like this:
public string Post([FromBody] string value)
{
...
}
and another parameterless one (provided by the wizard) like this:
public IEnumerable Get()
{
...
}
I have installed this in two separate locations on the web.
I can call the parameterless Get method and the FromBody Post method directly on each location from a .net console app and from a smartphone app with no problem. I may sometimes need to forward calls made to one location on to the other and this is where the problem comes. I find if I call the Post(FromBody) method on the service being forwarded that it is received by the location to which it has been forwarded without the parameter and so the second wizard generated parameterless method receives it by default.
I am using the RestSharp NuGet package.
The service being fowarded is being managed by Google domains and in the forwarding process I have specified the path to be included in the forwarding.
Is there some additional setting I need to specify in the calling code that will ensure that the FromBody parameter is passed on to be picked up by the ultimate destination rather than being discarded?
Any thoughts anyone has would be very welcome.
I was expecting the FromBody parameter to be passed on as part of the forwarding process
I've been running the echo.html example that comes with Strophe.js. When I start it up I sign in using a user I made called user1. When I click the connect button I get the following output:
Strophe is connecting.
Strophe is connected.
ECHOBOT: Send a message to 5ee09j8v8y#ubuntu/5ee09j8v8y to talk to me.
I am able to successfully test this example using the Gajim client. In Gajim I simply start a new chat using the above JID (5ee09j8v8y#ubuntu/5ee09j8v8y). When I send a message using Gajim it shows up on the echobot example and everything is hunky dory.
So here's my question, I see from this official site that the JID is in this format:
<JID> ::= [<node>"#"]<domain>["/"<resource>]
And I get that the resource is optional, and that the domain in my case above is simply my computer's name (my computer's name is ubuntu). BUT what I don't get is how the heck you get 5ee09j8v8y from the username user1.
The code inside echobot.js which prints the JID line above uses this command to get the information:
connection.jid
Which is just a Strophe.Connection Object retrieving it's JID.
So to sum all of this up, I cannot communicate from Gajim using user1#ubuntu/5ee09j8v8y the only way it works is when I use the JID 5ee09j8v8y#ubuntu/5ee09j8v8y. So what exactly is the node (5ee09j8v8y), how does it get mapped to the username (user1), how can I get Gajim to work with user1#ubuntu/5ee09j8v8y instead of using 5ee09j8v8y#ubuntu/5ee09j8v8y and at the very least can someone point me in the right direction to some documentation on this JID problem?
Note: This tutorial will explain my setup (and help others who are curious in how I set all of this up).
I'm using the pathologic module, and currently when a node is deleted users will get a 404 error. I want to set up a Rule such that when ANY node is deleted, a redirect is put in place to send users looking for that path to the HOME page.
Do I need Rules for this, and if so, what is the best method? I haven't been able to successfully get this to work so far because of the interaction between the nid and the pathologic-created redirect. Many of my users have been sent URLs in email, etc. and I don't want them to get a 404.
Thanks in advance!
One soulition could be for you:
install https://www.drupal.org/project/hook_post_action module
write your own module in which you implement hook_node_postdelete($node) in which you set a drupal_goto()
I have two questions:
Q: 1
I'm currently developing a GWT app. The entry point for the app is: ImageViewer.java. I could well access it by http://127.0.0.1:8888/ImageViewer.html?gwt.codesvr=127.0.0.1:9997. I have a service called "Search" which has corresponding "Async" and "Impl"'s defined. Now, I call the service from client side, using RPC. I could call the service, obtain return value. Everything works fine.
However, I expect the application to show a behavioral change on URL. i.e. when a service is being accessed, I thought it would be reflected on the browser's URL something like: http://127.0.0.1:8888/search?gwt.codesvr=127.0.0.1:9997 as I've modified web.xml. However, this behavior is not realized. Any particular reason why this is not reflected??
Q:2
This one is a reverse of the previous ques. i.e. I have an application running. Let's say it has an entrypoint class(Imageviewer.java) and another composite class (searchClass.java) which would be loaded on the Imageviewer based on an event. This searchClass invokes the "search" service mentioned in the previous question.
I could load the "searchClass" in "Imageviewer", invoke the service, and the service also returns the value needed. Everything works fine... But,
I need something like this: by just typing this query string:
http://127.0.0.1:8888/search?value=John
I want the "searchClass" to be loaded on the "ImageViewer", call the service using the value(which is "john" in this case) and display the result. Is this possible at all?
what I've tried: I have tried to create a httpServletClass on the server and mapped it with the URL and could do the search. The search returns appropriate results. However, I want the results from the server to be displayed on the client. Remember, I'm directly using a servlet to read the URL and so there is no value being passed from client to server.
Thanks in advance.
A: 1. To change URL, the hash part, you need to set new history token in the History class. More about history management in this article.
A: 2. For the second part you could achieve it by changing the history token, for instance "http://127.0.0.1/search#value=John". The history service will trigger an event if the # part changes. You could also use the part with "?", as in your example, if you use Window.Location , but it will cause reload of the application, which would put the whole idea of using GWT in question.
RPC (AJAX) calls are done Via XHR and do not change the browser URL.
You can't (with the URL you presented). GWT apps normally run in one web page, i.e. the URL does not change (see how gmail changes browser url bar). What you can do is enable GWT history support. Then your url would be http://host/#search?value=queryu
I want to make my system redirect unknown requests such as
www.address.com/a_company
to the adress
www.address.com/companies/company/ and display the company a_company if it exists in the database, otherwise throw the user to a 404 not found page.
So in detail, I want to make namespace that is as the first example dynamically, if the company exist in the database, I have no problem connecting to the database and retrieving information or finding a way to parse a company name, I just need help how to make my system check and run a function every time the address doesn't exist and show the second page (/companies/company/)..
I am using an Acl as well, but I think it should be fine if the page is /companies/company and then possibly add /?c=a_company or similar.
Thank you.
/Marcus
simply create a front controller plugin which checks the request params agains the database before the request is dispatched.