bazelbuild / bazelbuild/rules_closure

Binary files are not correctly served via the phantomjs_harness

Open
#196 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
159
Forks
111
PR merge metrics
No merged PRs in 30d

Description

There are two issues here, I guess. One is that the harness does not read the file in binary mode. A fix merely passes 'b' to fs.read when we are serving up a binary file.

The other issue is weirder. When serving a sample png file, the file is changed in some weird way. Specifically:

```
$ ls -l *.png
-rw-r--r--@ 1 applmak x 2669 Apr 4 08:24 test1x1.bad.png
-rw-r--r--@ 1 applmak x 2742 Apr 3 20:12 test1x1.png
```

Even weirder:

```
$ xxd test1x1.bad.png | head -n 3
00000000: efbf bd50 4e47 0d0a 1a0a 0000 000d 4948 ...PNG........IH
00000010: 4452 0000 00ef bfbd 0000 00ef bfbd 0803 DR..............
00000020: 0000 00ef bfbd efbf bdef bfbd efbf bd00 ................
$ xxd test1x1.png | head -n 3
00000000: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR
00000010: 0000 0080 0000 0080 0803 0000 00f4 e091 ................
00000020: f900 0002 7350 4c54 45ff ffff 3333 3333 ....sPLTE...3333
```

which seems to indicate some kind of encoding issue? This problem might be an issue with phantomjs itself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.