Skip to content

Commit

Permalink
Add request header to disallow gzip encoding for BAM files.
Browse files Browse the repository at this point in the history
Fix console message
  • Loading branch information
jrobinso committed Aug 5, 2023
1 parent 1526d93 commit e51b714
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions js/bam/bamReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class BamReader {
BamUtils.setReaderDefaults(this, config)

this._blockLoader = new BGZBlockLoader(config)

if (!this.config.headers) {
this.config.headers = {}
}
this.config.headers["accept-encoding"] = "gzip;q=0,deflate;q=0"
}

async readAlignments(chr, bpStart, bpEnd) {
Expand Down
2 changes: 1 addition & 1 deletion js/bam/bamSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BamSource {
if (StringUtils.isString(this.config.url)) {
const inferIndexPath = TrackUtils.inferIndexPath(this.config.url, "bai")
if (inferIndexPath) {
console.error(`Warning: no indexURL specified for ${this.config.url}. Guessing ${this.baiPath}`)
console.error(`Warning: no indexURL specified for ${this.config.url}. Guessing ${inferIndexPath}`)
this.config.indexURL = inferIndexPath
} else {
console.error(`Warning: no indexURL specified for ${this.config.url}.`)
Expand Down

0 comments on commit e51b714

Please sign in to comment.