Submitted POST with Select from in variable throws exception - post

I am submitting a POST form with a variable that accepts text input. I'm having an issue where, if the variable contains the two words "select" and "from" in the variable in that order but not subsequent, it gives an error 500 on the site. I do this on my development site and don't have the issue.
Prod Server info:
Linux version 2.6.32-573.12.1.el6.x86_64
(mockbuild#c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313)
PHP Version 5.6.25
Dev Server info:
Linux version 3.13.0-93-generic (buildd#lgw01-13) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
PHP Version 5.5.9-1ubuntu4.20
Sample POST output where error occurs:
[question] => 010101010101010101010101010101select0101010101010101010101010101from
I receive a 500 internal error and am unsure where to find the log files to get more info. Where do I start looking to resolve this?
I have searched google for "POST SUBMIT input select from causes 500 internal server error" and much more to no avail.

Looks like it was the hosting firewall blocking certain keywords. We found that the keywords "delete " and " from " or "select " and " from " were being blocked from gaining access to the site. I'm adding some jQuery with regex to alert the user that specific keywords in certain orders cannot be used.
I'm open to any other suggestions for how to prevent this from occurring or what would be a better option.

Related

401 HTTP response while using asyncpraw

I need to extract data from reddit (subreddits, posts, comments etc). I'm using asyncpraw and following the documentation:
pip install asyncpraw
import asyncpraw
reddit = asyncpraw.Reddit(
client_id="my client id",
client_secret="my client secret",
user_agent="my user agent",
)
I then try to get 10 “hot” submissions from r/test:
subreddit = await reddit.subreddit("test")
async for submission in subreddit.hot(limit=10):
print(submission.title)
I get the following response:
ResponseException: received 401 HTTP response
This is one of the basic things you can do listed in the Quick Start section on the site, but I already got an error, even though I followed the instruction. I get this when I try to do other things as well and don't understand why.
I tried browsing the site and got no results. I also tried running the script in myTerminal instead of the colab notebook and got the following error:
async for submission in subreddit.hot(limit=10):
^
SyntaxError: invalid syntax

Quectel M95 HTTP POST timeout error

I'm trying to send a POST to a server but I always get the +CME ERROR: 3821. I know that this means "HTTP to read timeout". Then, I tried to change the server to another one, just to test, and then I get the same error 3821. My AT commands list is:
AT+CGATT=1
AT+QIFGCNT=0
AT+QICSGP=1,"zap.vivo.com.br"
AT+QIACT
AT+QILOCIP (IP OK!)
AT+QHTTPURL=38,30
CONNECT
http://www.posttestserver.com/post.php
OK
AT+QHTTPPOST=10,50,80
CONNECT
helloworld
OK
+CME ERROR: 3821
Does anyone know what is wrong?
I solved it by using directly
AT+QHTTPPOST=10,50
and not
AT+QHTTPPOST=10,50,10
hello even the issue is one year old i am writing answer if any one needs. In the source file of "ril_http.c" of Quectel modules, add delay of minimum 10ms in HTTP call back handler. it will solve the timeout error and will able to post it successfully.

Jasper server integration in rails 2

I want to configure jasperserver-client gem in order to receive reports from Jasper server through SOAP.
The error I get is JasperServer::Error: JasperServer replied with an error: exception getting data strategy
after running the following from console:
client = JasperServer::Client.new("http://example.com/jasperserver-pro/services/repository", "jasperadmin", "jasperadmin")
request = JasperServer::ReportRequest.new("/public/test2", "PDF", { 'last_login_at' => '2013-01-15 00:00:00'})
pdf_data = client.request_report(request)
Any idea what might be the cause. I think that it's able to find the server and the report but it might be something wrong with the optional parameters.
I also tried generating the request without the option hash
I've solved my problem with this tutorial
http://jonif.blogspot.com.br/2012/07/

Mechanize unable to navigate KBB.com, get Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError

Trying to navigate KBB.com using Mechanize. I create a new agent
agent = Mechanize.new
works fine.
page = agent.get('http://www.kbb.com/toyota/mr2/1993-toyota-mr2/
styles/?intent=buy-used')
returns the page.
page.link_with(:text => "Choose this style").click
gives me this
page.link_with(:text => "Choose this style").click
Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError for
http://www.kbb.com /toyota/mr2/1993-toyota-mr2/coupe-2d/options/?
vehicleid=11263&intent=buy- used&pricetype=&path=&filter= -- unhandled response
works fine on craigslist. Why not kbb?
I was able to reproduce this, it looks like one of the cookies is corrupted. Any additional request fails.
You can work around this by clearing out the cookie jar before each request.
agent.cookie_jar.clear!
I was having the same problem on a simple form (site: http://www.myresaleweb.com/). It turns out I had accidentally swapped two of the field values when submitting through Mechanize, which caused this particular site to throw the 500 response code error. When I fixed the two values then it worked right away.
The reason I couldn't replicate it on the browser was that I was doing it correct manually. Once I attempted it incorrectly manually (just to confirm the error) then I was able to reproduce the 500 error code via the browser.

Rails + Nokogiri + Heroku - response 503 for URLs from StackOverflow

I'm writing a just-for-fun app for my use. In this app I'm putting URLs in classic POST form from which I'm extracting some informations. For example, this line is where I'm extracting the title of the page:
self.name = Nokogiri::HTML(open(self.url)).css('title').to_s.sub('<title>','').to_s.sub('</title>','')
I'm using Nokogiri (v1.5.4) for parsing data from the source page. I don't know if I'm missing here something, but the behavior of the application is strange.
If I'm running on my localhost in my development environment on my machine, everything works properly and seems to me alright. But, after pushing on Heroku, some problems occurred. For example, URLs from StackOverflow always have this type of error:
OpenURI::HTTPError (503 Service Unavailable):
app/models/url.rb:67:in `set_name'
app/controllers/urls_controller.rb:48:in `block in create'
app/controllers/urls_controller.rb:46:in `create'
I don't understand why it is happening just on Heroku. On my local machine it's working perfectly with the same URL. I'm maybe missing something with Heroku, but other URLs are returning the normal 200 state and working fine. It's just URLs from StackOverflow.
Don't use:
.to_s.sub('<title>','').to_s.sub('</title>','')
Instead use:
.text
For instance:
html = '<head><title>foo</title></head>'
Nokogiri::HTML(html).css('title').text
In IRB:
irb(main):055:0> html = '<head><title>foo</title></head>'
"<head><title>foo</title></head>"
irb(main):056:0> Nokogiri::HTML(html).css('title').text
"foo"
Why URLs for StackOverflow fail on Heroku fail with a 503 might be a routing or hosting issue since you're getting a 503.
Rather than scraping pages, you might want to consider "Where is Stack Overflow's public data dump?" and "
Stack Overflow Creative Commons Data Dump".

Resources