0

I've been tasked with diagnosing an issue with a webpage, and I've been able to trace the issue back to a gzip'ed JavaScript file, jquery.min.js.gz. To view the code, I've downloaded and attempted to unzip the file on my Linux machine. I'm met with a not in gzip format error.

The file jquery.min.js.gz command returns that the file is "data", and head jquery.min.js.gz returns the attached (StackExchange seems forbids posting some of what appear to be Korean characters). Examining the file in Vim, it contains the sort of binary data I'd expect from a gzip file.

What's going on here?

  • 2
    I don't think posting that data to a text pastebin helped very much; I don't think what we download is what you posted. Can you download the file using `scp` or some other non-http-based mechanism, and then compare the web download with the alternate download? Using a hexdump tool (e.g., `xxd`, which comes with `vim`, or `od`, which is part of `coreutils`) can help with this. – larsks Jun 08 '22 at 02:52
  • What web server are you using to serve out this file? – larsks Jun 08 '22 at 02:53
  • Is that jquery.min.js.gz file downloaded and de-compressed OK by a browser such as firefox or chromium? or is the error that the jquery file is corrupted? If corrupted, you know what the problem is and can just replace it with a good copy of jquery (but first find out which version of jquery your web app needs and grab that). What headers does the server return for that file? If you have libwww-perl installed, you can use `HEAD "$URL"` to see the headers, otherwise use something like `wget -S "$URL"`. It should have `Content-Type: application/x-gzip` in the headers. – cas Jun 08 '22 at 04:16
  • note that `HEAD` is all caps, and is a completely different program to `head` (lowercase). HEAD is program included with `libwww-perl` and shows the headers for a web request. head is a standard utility that shows the first n lines (default 10) of a file. also, please don't post output of HEAD in a comment. edit your question and add it there. – cas Jun 08 '22 at 04:21
  • pastebin is **not** meant to host binary files - what we see is not what you have. – Artem S. Tashkinov Jun 08 '22 at 09:33

0 Answers0