Avoid chunked content encoding. Some WebViewClient debugging. Doesn't go to a blank screen on android so much.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4314 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-05-23 23:26:07 +00:00
parent b4629acc48
commit da50792500
3 changed files with 17 additions and 3 deletions

View File

@ -499,6 +499,10 @@ apkgo: out/TildeFriends-debug.apk
@adb shell am start com.unprompted.tildefriends/.MainActivity
.PHONY: apkgo
apklog:
@adb logcat *:S tildefriends
.PHONY: apklog
clean:
rm -rf $(BUILD_DIR)
.PHONY: clean

View File

@ -504,7 +504,7 @@ async function staticFileHandler(request, response, blobId, uri) {
let id = `${stat.mtime}_${stat.size}`;
if (request.headers['if-none-match'] === '"' + id + '"') {
response.writeHead(304, {});
response.writeHead(304, {'Content-Length': '0'});
response.end();
} else {
let data = await File.readFile('core/' + path);
@ -538,7 +538,7 @@ async function staticDirectoryHandler(request, response, directory, uri) {
let id = `${stat.mtime}_${stat.size}`;
if (request.headers['if-none-match'] === '"' + id + '"') {
response.writeHead(304, {});
response.writeHead(304, {'Content-Length': '0'});
response.end();
} else {
let data = await File.readFile(directory + filename);
@ -626,7 +626,7 @@ async function blobHandler(request, response, blobId, uri) {
let id = `${stat.mtime}_${stat.size}`;
if (request.headers['if-none-match'] === '"' + id + '"') {
response.writeHead(304, {});
response.writeHead(304, {'Content-Length': '0'});
response.end();
} else {
let data = await File.readFile('core/' + k_static_files[i].path);
@ -664,6 +664,7 @@ async function blobHandler(request, response, blobId, uri) {
let id = await new Database(match[1]).get('path:' + match[2]);
if (id) {
if (request.headers['if-none-match'] === '"' + id + '"') {
headers['Content-Length'] = '0';
response.writeHead(304, headers);
response.end();
} else {
@ -676,6 +677,7 @@ async function blobHandler(request, response, blobId, uri) {
}
} else {
if (request.headers['if-none-match'] === '"' + blobId + '"') {
headers['Content-Length'] = '0';
response.writeHead(304, headers);
response.end();
} else {
@ -684,6 +686,7 @@ async function blobHandler(request, response, blobId, uri) {
}
} else {
if (request.headers['if-none-match'] === '"' + blobId + '"') {
headers['Content-Length'] = '0';
response.writeHead(304, headers);
response.end();
} else {
@ -787,6 +790,7 @@ async function blobHandler(request, response, blobId, uri) {
let headers = {
'Access-Control-Allow-Origin': '*',
'Content-Security-Policy': 'sandbox',
'Content-Length': '0',
};
response.writeHead(304, headers);
response.end();

View File

@ -159,6 +159,12 @@ public class MainActivity extends Activity {
.show();
return true;
}
@Override
public boolean onConsoleMessage(android.webkit.ConsoleMessage consoleMessage) {
Log.d("tildefriends", consoleMessage.message() + " -- From line " + consoleMessage.lineNumber() + " of " + consoleMessage.sourceId());
return true;
}
});
web_view.setWebViewClient(new WebViewClient() {