Skip to content

Instantly share code, notes, and snippets.

@asm256
Created January 14, 2015 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asm256/04c2e4e922f9457aad51 to your computer and use it in GitHub Desktop.
Save asm256/04c2e4e922f9457aad51 to your computer and use it in GitHub Desktop.
thx >>5,>>6
diff --git a/chaika/modules/server/thread.js b/chaika/modules/server/thread.js
index 97dd198..e5b55cd 100644
--- a/chaika/modules/server/thread.js
+++ b/chaika/modules/server/thread.js
@@ -843,10 +843,14 @@ Thread2ch.prototype = {
// 差分GET
if(this.thread.datFile.exists() && this.thread.lastModified){
let lastModified = this.thread.lastModified;
- let range = this.thread.datFile.fileSize - 1; //あぼーんされたか調べるために1byte余計に取得する
- this.httpChannel.setRequestHeader("Accept-Encoding", "", false);
this.httpChannel.setRequestHeader("If-Modified-Since", lastModified, false);
- this.httpChannel.setRequestHeader("Range", "bytes=" + range + "-", false);
+ if(this.httpChannel.URI.host.match(/2ch\.net$/)){
+ this.httpChannel.setRequestHeader("Accept-Encoding", "gzip", false);
+ }else{
+ let range = this.thread.datFile.fileSize - 1; //あぼーんされたか調べるために1byte余計に取得する
+ this.httpChannel.setRequestHeader("Accept-Encoding", "", false);
+ this.httpChannel.setRequestHeader("Range", "bytes=" + range + "-", false);
+ }
this._aboneChecked = false;
}else{
this.httpChannel.setRequestHeader("Accept-Encoding", "gzip", false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment