How to check http status code in Casperjs? - casperjs

I want to check http status code using casperjs. I have 500 links and I want to check status code of each link.

I hope this suggestion can fit you!
In the very site of the official documentation there are some code examples for you to implement.
In your case, you can achieve this status control of 3 different ways:
Using resource.received,resource.requested or individually in each status control routine http.status.[code].
To work with resource.received, you can see an example in this link.
To work with resource.requested, you can see an example in this link.
To work with http.status.[code], you can see an example in this link.
I hope you can help you! See you later...

Related

Moodle Moove Child Theme

I am trying to make a child theme for 'Moove' in moodle 3.6! But as soon as I update my database and click on theme selector button, I get an HTTP 500 error!
I follow the instruction from the blog below, but apparently, I am doing something wrong. Can sb help me please?
https://edwiser.org/blog/create-child-theme-moodle/
Error 500 usually means there is something wrong in your scripts/configuration.
First thing to do would be to enable debugging messages to see what exactly is wrong.
Here you can find how to enable debug output to get more detailed error messages: https://docs.moodle.org/36/en/Debugging#In_config.php

Follow up - Configuring MODx Revolution to work with both http and https

This question is follow-up for this topic:
Configuring MODx Revolution to work with both http and https.
For even more details see this
MODX forum post
I face the same problem as described there and I use suggested solution. Just in my case I found the situation when it does not work.
I use MODX extra called FormIt (you probably know it) - it processes the forms and then redirects to 'thank you' page. What I have problem with is this redirect. It also uses makeUrl() but the snippet mentioned in the original post does not help here because in FormIt class the whole context config is regenerated, so site_url contains again [[++url_scheme]] and redirect ends in address like:
https://www.example.com/[[++url_scheme]]www.example.com/[[++url_scheme]]www.example.com/thank-you-page.html
instead of
https://www.example.com/thank-you-page.html
I wonder if you could know about some workaround, please?
thank you in advance!
Succeeded to resolve the issue.
What helped was to create new hook which does something like:
$modx->config['site_url'] = $modx->config['url_scheme'] . substr($modx->config['site_url'], strlen('[[++url_scheme]]'));
and then add this hook right before redirect hook in FormIt call

Dredd - API Blueprint Testing Tool. "Undefined" issue

I installed dredd - API Blueprint Testing Tool and trying to test our APIary API against the implementation.
In the blueprint I have just one resource which is correctly implemented on somehost... but test fails :(
test command:
dredd apiary.apib http://somehost.de:8443/imp-endpoint
output:
Info: Beginning Dredd testing...
undefined
I tried also with more options to get more information what is undefined.. like -l verbose and some other options. But I did not get more information about the failure :(
Does anyone have experience with it? Thank you!!! :)
Answered on Github but I'll reproduce the main points here for reference:
I wasn't able to to reproduce your "undefined" problem, but there are a few issues that, when corrected, make everything work.
At the moment, the base url can't have a path in it (see #43). This is solved in #45 but hasn't yet been merged. So your command should be 'dredd apiary.apib http://somehost.de:8443/' and then '/imp-endpoint' should be a prefix on the urls.
The URI template is incorrect in your apib file. Instead of /api/V0/Resources/CarSharing/Cars?{lat}&{lng}&{radius}, it should be /imp-endpoint/api/V0/Resources/CarSharing/Cars{?lat,lng,radius}. See RFC6750 for reference.
The line-endings should be Unix style, not Windows (\n, not \n\r). When I first ran the apib you provided, I got the error: the use of carriage return(s) '\r' in source data isn't currently supported, please contact makers (this is actually enforced by the blueprint parser, see snowcrash)
Hope that helps! I get a 401 when running the test, so you'll need to provide HTTP Basic authentication information (this can be done in the header section of the blueprint or with the -u flag on dredd, as in -u username:password)

Twitter handler (sensu and ruby) troubleshooting

I'm trying to get Sensu twitter-handler working on my environment. The issue is that I'm not getting any errors on screen or logs when I cat a .json event into the twitter-handler and, the tweets are not being shown on the linked account.
Here're are my config files:
https://gist.github.com/Mariano-gon/8648427
https://gist.github.com/Mariano-gon/8648455
https://gist.github.com/Mariano-gon/8648489
This is the output I get:
https://gist.github.com/Mariano-gon/8648480
One important note is that in sensu-api.log the request are being recieved:
https://gist.github.com/Mariano-gon/8673758
So, my question is: is there a way to troubleshoot this issue? Any way to debug the handler.rb?
Thanks!
Finally got it working! Thing was the new 'twitter' gem (in my case v5.6) won't work with the code as it was written. I needed to follow this great answer and this thread too. Was just a matter of sintaxis (as usual).
Thanks!

Unable to upload files to AWS S3 buckets using CORS

I was just trying out the example which is specified in this blog, but I am getting this error "Could not contact signing script. Status = 404". I followed all the steps specified in the blog and also carefully changed the CORS configuration in AWS management Console too. I am not able to figure out the problem. Kindly help me out.
Here is the blog link http://www.ioncannon.net/programming/1539/direct-browser-uploading-amazon-s3-cors-fileapi-xhr2-and-signed-puts/
I faced the same problem you did trying to follow the example in this blog post. I wrote an article showing everything I had to do to make it work for me.
https://blog.pjam.me/posts/direct-upload-to-s3/
Hope it'll work for you.

Resources