Wicket Modal Windows empty if behind Proxy - proxy

Hi all you genius people!
Has anybody ever had a problem with modal window's content when using the web site from behind a proxy? Sadly I cannot provide any details about the proxy configuration. (It's the proxy of a foreign company.)
I can tell you though that it is a Squid proxy and that there are no explicit error's in Wicket's ajax debug windows or the server log. Proxy admin also says there's nothing blockek in the logs. Wicket actually returns an empty div to be displayed in the modal window's content:
<div id="contentd" style="display:none"></div>
This is what is returned when I do not have the proxy between me and wicket:
<div id="content10">
<form>
<table align="center" cellspacing="5px" width="100%">
<tr>
<td colspan="2" align="center">
<span><p>Möchten Sie den Monitor wirklich löschen?</p></span>
</td>
</tr>
<tr>
<td align="center">
<input type="button" value="Ok" class="button" id="confirm15" onclick="var wcall=wicketAjaxGet('?wicket:interface=:1:uniModal:content:confirm::IBehaviorListener:0:-1',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('confirm15') != null;}.bind(this));return !wcall;">
</td>
<td align="center">
<input type="button" value="Abbrechen" class="button" id="confirmNot16" onclick="var wcall=wicketAjaxGet('?wicket:interface=:1:uniModal:content:confirmNot::IBehaviorListener:0:-1',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('confirmNot16') != null;}.bind(this));return !wcall;">
</td>
</tr>
</table>
</form>
</div>
(Sry for this horribly dirty html code, not a work of mine. ^^)
My guess is that the proxy captures parameter's that should arrive at wicket but never do. I switched on DEBUG for org.apache.wicket but can't find anything that might seem useful. Does anybody know an instant solution or have any ideas how to look into this further? After DEBUG logging showed nothing I pretty much ran out of ideas.
Maybe someone can read something out of the wicket logs:
Working without proxy - http://pastebin.com/Agi2JMJM
Not working with proxy - http://pastebin.com/hfzXDHtq
Thanks in advance!

The actual solution was quite easy, now that I know the details. Wicket uses two custom headers when handling modal windows:
wicket-ajax
wicket-focusedelementid
Without these headers wicket seems to be unable to identify the correct modal frame object or similar. The company's proxy server blocked all non-whitelisted headers. After tweaking the proxy server to allow the headers above everything worked like a charm.

Related

Google Analytics API request returns captcha?

Since yesterday, our connection to the Google Analytics API returns an HTML page with... captcha. Does anyone experience something like this?
We use the API with the PHP library. Our code for retrieving a report (its wrapped in our own class but it uses the google/apiclient package):
// Create analytics
$this->analytics = new \Google_Service_AnalyticsReporting($this->client);
// Create the ReportRequest object.
$request = new \Google_Service_AnalyticsReporting_ReportRequest();
$request->setViewId($view_id);
$request->setDateRanges($this->dateRanges);
$request->setMetrics( array_values( $this->metrics ) );
$request->setDimensions( array_values( $this->dimensions ) );
$request->setSegments($this->segments);
$body = new \Google_Service_AnalyticsReporting_GetReportsRequest();
$body->setReportRequests( array( $request) );
try {
$reports = $this->analytics->reports->batchGet( $body );
}
catch(\Google_Service_Exception $e)
{
echo"Error (1)...\n";
echo $e->getMessage() . "\n";
$this->lastError = json_decode($e->getMessage());
return false;
}
We catch a Google Service Exception, and the message of the error is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content="initial-scale=1"><title>https://analyticsreporting.googleapis.com/v4/reports:batchGet</title></head>
<body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById('captcha');if(e){e.focus();}">
<div style="max-width:400px;">
<hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>
<form id="captcha-form" action="index" method="post">
To continue, please type the characters below:<br><br>
<img src="/sorry/image?id=14645528721876966739&q=EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj&hl=en&continue=https://analyticsreporting.googleapis.com/v4/reports:batchGet" border="1" alt="Please enable images"><br><br>
<input type="text" name="captcha" value="" id="captcha" size="12" style="font-size:16px; padding:3px 0 3px 5px; margin-left:0px;"><br><br><br>
<input type="submit" name="btn-submit" value="Submit" style="font-size:18px; padding:4px 0;">
<input type='hidden' name='q' value='EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj'><input type="hidden" name="continue" value="https://analyticsreporting.googleapis.com/v4/reports:batchGet">
</form>
<hr noshade size="1" style="color:#ccc; background-color:#ccc;">
<div style="font-size:13px;">
<b>About this page</b><br><br>
Our systems have detected unusual traffic from your computer network. This page checks to see if it's really you sending the requests, and not a robot. Why did this happen?<br><br>
<div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the Terms of Service. The block will expire shortly after those requests stop. In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests. If you share your network connection, ask your administrator for help — a different computer using the same IP address may be responsible. Learn more<br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known to use, or sending requests very quickly.
</div>
IP address: xxx.xxx.xxx.xxx<br>Time: 2019-11-19T08:25:44Z<br>URL: https://analyticsreporting.googleapis.com/v4/reports:batchGet<br>
</div>
</div>
</body>
</html>
If anyone experiences this too or has a solution, please let me know.
Thanks in advance.
This may have been Google applying some safety measures to handle a large spike in traffic. I am also aware they updated their error messages for the API as of the 4th November 2019 which may be why we are now getting this error instead of something else previously.
Email I received from Google:
"we’re upgrading the Google Analytics APIs to a new technical infrastructure stack beginning November 4, 2019. As a result of this change, clients will see some differences in the response error message text for failed API requests."
"If your application or log analysis workflow rely on the specific wording provided in responses of the Management API v3 or Core Reporting API v3, you will need to update the code to reflect the new error response text. Please note that as exact error message wording can change at any time, we strongly discourage hardcoding the specific message text when processing responses from the API."
Today my requests failed and a captcha image was provided in my error log that produced a 404.
Error I received:
"Our systems have detected unusual traffic from your computer network. This page checks to see if it's really you sending the requests, and not a robot."
"The block will expire shortly after those requests stop. In the meantime, solving the above CAPTCHA will let you continue to use our services."
I have since found the service to be back running in small doses without any code changes required.
I suggest to try again and limit the number of requests until the service is back 100%.

Spring Boot Application not changing

I've done a project before. (https://github.com/sercandorman/CRUD-Operations-With-Spring) Now I wanted to go through it. When I add a html file into resources/templates, I can see the page. And in that page I'm trying to get data from mysql database. Meanwhile I tried to use same ajax/get method but faced 404 no messages found error. And I'm sure that Im using right RequestMapping and Thymeleaf iterations. Already I've used before so I did same things but just from different table. I could not understand 'why'!? ...
Then I've tried changing the RequestMapping method(findAll) that was working before. AND NOTHING CHANGED. Method still running as old way ! I'm trying to broke it, but no, nothing happens. How it can be possible ?!
Note : I've tried to open project Spring Tool Suite and Netbeans. After facing tousands of error, successfuly opened project with STS but look at it. I can not change its original form.
Is this about war/jar files ?! What should I do ?
findAll method (Working)
#RequestMapping(value = "/findAll", method = RequestMethod.GET)
public void findAll() {
mavIndex.addObject("allRecords", personService.findAll());
mavIndex.addObject("mod", "VIEW_RECORDS");
}
with this ;
<div class="row" id="getResultDiv" th:switch="${mod}">
...
<div th:case="VIEW_RECORDS">
...
<tbody>
<tr th:each="result : ${allRecords}">
<td th:text="${result.id}" id="tid"></td>
<td th:text="${result.name}" id="tname"></td>
<td th:text="${result.surname}" id="tsurname"></td>
</tr>
</tbody>
</div>
</div>
But when I do that;
#RequestMapping(value = "/lists", method = RequestMethod.GET)
public void findAllLists() {
mavIndex2.addObject("allLists", listsService.findAllLists());
mavIndex2.addObject("mod2", "VIEW_LISTS");
}
with this ;
...
<tbody>
<tr th:each="res : ${allLists}">
<td th:text="${res.listname}"></td>
</tr>
</tbody>
Also I'm sure that Services and Repositories are same.
As I mentioned above, when I change /findAll method nothing changing and my /lists method not working.
What must I do ?
I'm neither a Netbeans nor an STS expert but to rule out any problems which come from your IDEs you could try the following:
A complete rebuild and start of your project, so that any changes in Java or resource files have a chance to be reflected in your next server start:
mvn clean spring-boot:run
Please make sure that you stop all running servers you started earlier.

Error in ASP classic upload form ( ASP Uploader)

I'm working on a ASP classic website In that I'd a requirement of uploading images to website. My website is hosted on 1 & 1. I've downloaded ASP up-loader and wrote the following code suggested in ASP Up-loader help page http://aspuploader.com/Deployment.html. My code looks like
Dim uploader2
Set uploader2=new AspUploader
uploader2.Name="myuploader"
uploader2.SaveDirectory="savefiles"
uploader2.AllowedFileExtensions="*.jpg,*.png,*.gif"
uploader2.Render()
and my html page looks something like this
<div>
<table>
<tr>
<td> Upload Image:
<input type='file' onchange="readURL(this); " name="File1" />
<img id="img" src="#" alt="your image" />
</td>
</tr>
</table>
</div>
Now My question is after running the above code I ran into following error
Scripting.FileSystemObject error '80040401'
Permission Denied
/aspuploader/resources/coreimpl.js, line 1
I have changed file permissions also in 1 & 1 for my webfiles but still I'm getting same error message.
Any ideas would be very helpful.

FineUploader 3.6.0 object File is not a File or INPUT element Ignoring

I am trying to integrate fine uploader into my hybrid mobile app (using Icenium). I have all the files needed and the uploader runs perfectly when I'm running the app in the simulator. When I run my app on my iphone I get the [FineUploader 3.6.0] [object File] is not a File or INPUT element! Ignoring!. I can't for the life of me figure out why I would be getting this.
This is my config...
$(document).ready(function() {
$('#fineUploader').fineUploader({
request: {
endpoint: 'uploadurl'
}
});
});
I have navigated to the demo page for the jquery wrapper which uses the previous config and the demo runs fine. Any ideas? I'm not sure how to debug this any further.
Thanks
EDIT:
View -
<div data-role="view" id="queue-view" data-title="Queue" data-show="app.queueView.show" data-transition="slide:left" style="display: none;">
<header data-role="header">
<div data-role="navbar">
<a data-align="left" data-icon="menuicon" data-role="button" data-click="app.applicationLayout.onMenuClick"></a>
<span data-role="view-title"></span>
</div>
</header>
<button id="filesButton">Add Files</button>
<div id="fineUploader" class="upload-cont">
</div>
<div id="fineUploader2" class="upload-cont">
</div>
<input id="cameraButton" type="file" name="camera" accept="image/*;capture=camera">
</div>
ViewModel (app.queueView.show) -
$('#fineUploader').fineUploader({
request: {
endpoint: 'uploadurl'
}
});
I have also tried the direct from camera code which simply gives me undefined errors. That's why there is an extra fineUPloader2 and the cameraButton. I have tried a lot of things and all seem to result in either undefined errors or the No files error.
I'm also using require.js to bring in my javascript files (which I have many since I have set my project up using MVVM).
Thanks
Your issue was caused by a bug in Fine Uploader that appeared only when File objects are created in a frame/window/context other than the frame/window/context where the uploader instance was created. There are a couple issues filed here. Yours, (#870) and another, similar issue (#866). The issue was caused by the use of instanceof to determine if an object was a File. Both cited issues have been fixed in the associated hotfix branch in the Github project. I plan on pushing out a 3.6.1 hotfix release with these fixes in the next 24 hours or so.

Testing a method that implements IHttpHandler.ProcessRequest

So I have a method that implements IHttpHandler.ProcessRequest. It accepts an HttpContext parameter. This parameter is just a form that is filled out with some XML. Here is the HTML that I am using to generate the post context:
<html>
<body>
<form name="form1" method="post" action="http://localhost:7703/api.ashx">
<textarea name="XML" id="XML" rows="25" cols="100"></textarea>
<br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
As you can see, very simple. This is just used for testing purposes. What I am doing is posting XML in that textbox, and hitting submit. However, I am not sure what to attach my visual studio project to in order to debug. I try attaching it to w3wp.exe like I do when I test the app in a browser and stuff, but that doesn't seem to be working. It still says "This breakpoint will never be hit, no symbols loaded..." blah blah blah, when I put a breakpoint next to the ProcessRequest method and attach.
How do I test this properly?
Thanks guys.
If you run this locally you should be able to "run" it from within Visual Studio and VS will automatically attach it self to the correct process.
If I attach to the development server at the same port as the post, it works! :)

Resources