Skip to content

Commit 46dea78

Browse files
author
zhourenjian@gmail.com
committed
Update pipe on receiving data
Update user-agent on HttpRequest
1 parent 019d26b commit 46dea78

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sources/net.sf.j2s.ajax/ajaxcore/net/sf/j2s/ajax/HttpRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ private void request() {
443443
connection.setDoInput(true);
444444
connection.setRequestMethod(method);
445445
connection.setRequestProperty("User-Agent",
446-
// "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 GTB5 (Java2Script/2.0.0)");
447-
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 GTB5");
446+
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5");
448447
if ("post".equalsIgnoreCase(method)) {
449448
connection.setDoOutput(true);
450449
connection.setRequestProperty("Content-Type",

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,8 @@ protected IXHRReceiving initializeReceivingMonitor() {
800800
static void pipeContinuum(final SimplePipeRunnable runnable) {
801801
HttpRequest pipeRequest = getRequestWithMonitor(new HttpRequest.IXHRReceiving() {
802802
public boolean receiving(ByteArrayOutputStream baos, byte b[], int off, int len) {
803+
runnable.updateStatus(true);
804+
803805
baos.write(b, off, len);
804806
/*
805807
* It is OK to convert to string, because SimpleSerialize's

0 commit comments

Comments
 (0)