Getting "Path not found: POST /" error when submitting contact form hosted on DataFire - contacts

I have a static site that uses a contact form that is hosted on a fork of this repo: https://app.datafire.io/projects?baseRepo=https:%2F%2Fgithub.com%2FDataFire-repos%2Fcontact-us-base
Everything seems to be in order and it works successfully and delivers emails when I test it on Datafire, but when deployed on my site, sumbitting the form gives me the error "Path not found: POST /", so I'm not sure why I get this routing error when I try to submit it from my site.
This is the form action:
<form action="https://sub-tm.prod.with-datafire.io" method="post">
and as I said, it works when tested from DataFire.
edit: I just noticed the log on datafire shows this:
WARNING! Unable to find a Swagger path that matches "/"

It looks like your action is on the /contact endpoint. So it should work if you change the URL to https://sub-tm.prod.with-datafire.io/contact

Related

Redirects issue in ngrinder groovy-Eclipse plugin

I am facing an issue when I am scripting the redirects in nGrinder (Script written in Groovy in Eclipse; Eclipse integrated with Groovy plugin) for the URL: https://winterfell-sbo-sbo-test-cso-web-mta.cfapps.sap.hana.ondemand.com/sites
Attached is the Eclipse log (Page #11, #12, #13) for your reference and below is the explanation on the issue.
Step#1
I fire a HTTP GET request on https://winterfell-sbo-sbo-test-cso-web-mta.cfapps.sap.hana.ondemand.com/sites.
This automatically follows redirects and then lands on to the Login Page: https://winterfell.authentication.sap.hana.ondemand.com/login
Step#2
I fire another HTTP GET request on 'https://winterfell.authentication.sap.hana.ondemand.com/saml/discovery?returnIDParam=idp&entityID=winterfell.canary&idp=winterfell-metadata&isPassive=true
This doesn't automatically redirect to "Location" header -> https://winterfell.authentication.sap.hana.ondemand.com/saml/login/alias/winterfell.canary?disco=true&idp=xs2security.accounts400.ondemand.com
Refer to the screenshot for more information.
Instead it gets redirected to https://winterfell.authentication.sap.hana.ondemand.com/login
We tried to capture and set the csrf cookie for the GET request of https://authentication.sap.hana.ondemand.com/saml/discovery?returnIDParam=idp&entityID=winterfell.canary&idp=winterfell-metadata&isPassive=true -> but still it isn't working as expected
Colleague was able to make this work in JMeter. So we are trying to simulate this in nGrinder by setting "followRedirects" to true and it isn't working as expected.
Since in Step#2, it is not picking up the location of the response header and redirecting back to "/login" page, what could be the possible reasons for this behavior?
we checked if xsuaa is working fine. On executing the request in Postman, everything worked as expected. Curl works well.

Email/Password Authentication Mongodb-stitch Android API

This seems to be on a very new topic because the "stitch" or "mongodb-stitch" tags do not exist yet.
I have a mongodb altas cluster on cloud.mongodb.com. The page https://docs.mongodb.com/stitch/auth/email-auth/ only teaches how to do things with JS but I don't have server side JS on hand. Instead I tried to figure out how to do things with the StitchClient on the Android API.
I was able to register an email/password pair using StitchClient.register(email,pwd) and got an email from no-reply+stitch#mongodb.com with the token/tokenId. I copied them and used StitchClient.emailConfirm(token, tokenId) but failed. The error was:
Unexpected response code 404 for https://stitch.mongodb.com/api/client/v1.0/app/APP-ID/auth/local/userpass/confirm
which sounds strange! I opened a browser and paste that in the URL and got 404 too. I even did
curl --data "token=432...345&tokenId=435..334" https://stitch.mongodb.com/api/client/v1.0/app/APP-ID/auth/local/userpass/confirm
and still got 404.
Is this a bug or an outage of the stitch.mongodb.com server?

Firefox SDK: Redirect to ressource HTML denied

I'm trying to write a Firefox Addon with the Addon SDK to redirect some websites based on their URL. I have created a HTML page and put it in the data directory. I get the path with:
var data = require("sdk/self").data;
var myWebsite = data.url("myWebsite.html");
I'm using PageMod to start a script given an array of URLs:
pageMod.PageMod({
include: ArrayOfUrls,
contentScriptFile: "./myScript.js",
contentScriptOptions: {"myWebsite" : myWebsite}
});
In myScript.js I'm checking if some requirements are fulfilled and if so I try to redirect to my local website with:
window.location.replace(self.options.myWebsite);
But I always get the following error message in the console:
Object
- _errorType = Error
- message = Access to 'resource://myAddon/data/myWebsite.html' from script denied
If I enter the path to the local website (resource://myAddon/...) manually in the adress bar of the browser it works. If I redirect to another website (e.g. http://example.com/) it works as well.
So I guess there's a security setting or so I need to change to make the local redirect possible, but I can't find anything in the documentation or on the web. I hope somebody here can tell me what I'm doing wrong.
In package.json I had to add the following line to make it work:
"permissions": {"cross-domain-content": ["resource://myAddon/data/"]}
Further documentation can be read in link Noitidart provided in his comment.

get current domain in a template called from service grails

I use the grails mail plugin to send mail, I have to send an email from the service and from this i use the grails mail plugin: http://grails.org/plugin/mail
So I have this code:
mailService.sendMail {
async true
to 'hello#world.fr'
from 'world#hello.fr'
subject subj
body (view:'/mail/_mailTemplate')
}
So at this point everything's fine , my method send email.
In my mail template i have the image pippo.png that i have to show, and I do it in this way.
<img src="${resource(dir: 'images/mailImage', file: 'pippo.png',absolute:true)}">
In the generated html the link that i get as a result for that image is :
http://localhost/images/mailImage/pippo.png
with this link is obvious that the mail client will never find the image.
but when i render the same template from a controller i get:
http://www.mycorrectdomain/images/mailImage/pippo.png
so how can I get the current domain even when i render my template from the service?
In the grails documentation of the resource tag, it says:
absolute (optional) - If true will prefix the link target address with the value of the grails.serverURL property from Config.groovy, or localhost if there is no setting in Config.groovy and not running in production.
So, I'm guessing the reason you are seeing localhost is because you haven't configured your URL in Config.groovy, or, you are not running in production model.
To change the default URL, in Config.groovy:
grails.serverURL = "http://www.thecorrectwebsite.com"
To run in production mode: grails production run-app should do the trick.

CakePHP Facebook plugin error in HTTPS not in HTTP

I have set up the facebook plugin like the instructions.
Downloaded package and installed in app/plugins/facebook
Created app/config/facebook.php with my app's id, key and secret numbers, based on the example config file
Included $helpers = array('Facebook.Facebook') in my app_controller.php
Echoed the $this->Facebook->html() function in my layout (replcing the default html tag)
Echoed the $this->Facebook->init() function at the bottom of the layout, before
I run this code:
echo $this->Facebook->share('link');
If I go to: http://myhomepage.com it works but if I go to the same with HTTPS I just get a text share. In IE 10 and Chrome I get a Not safe content error. If I accept it it works.
How do I run it over SSL? I have bought the certificate, so it is valid and not a home-made self-signed one. I am running Cake PHP version 2.
I have tried to search the web, but I just find problems with the login function and not with the share button.
Please follow the below links for reference.
http://www.afbtemplates.com/tutorials/common-problems-facebook-secure-connections
http://developers.facebook.com/blog/post/497/
Do I need to support ssl on my site that allows login through facebook connect