Coder Social home page Coder Social logo

Comments (8)

johno avatar johno commented on June 12, 2024 1

I suppose there's no harm in us attempting to parse a plain text content response, that way it'd account for things like GitHub Gists.

from cssstats.

kolaente avatar kolaente commented on June 12, 2024

In a previous run /stats would return a 500 with an error message but I cannot reproduce that anymore unfortunately.

from cssstats.

johno avatar johno commented on June 12, 2024

Looks like this has to do with the fact that gist return text/plain for .txt files.

$ curl -I https://gist.githubusercontent.com/kolaente/7c3e8e7c91f0409c2fed2182ee547605/raw/dcb3e35fce01ec411144917269d64f26bc176348/gistfile1.txt
HTTP/2 200 
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: "fc09f93056511600514aa9727f872a9d4229914bd6602d911bb7260866fc0ad9"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: EAC2:2C27:1AA66E:20E1B7:606E2040
accept-ranges: bytes
date: Wed, 07 Apr 2021 21:12:32 GMT
via: 1.1 varnish
x-served-by: cache-phx12423-PHX
x-cache: MISS
x-cache-hits: 0
x-timer: S1617829953.585614,VS0,VE115
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
x-fastly-request-id: ffbaef3a793db1cd4a657c71a27f1c8612f3677f
expires: Wed, 07 Apr 2021 21:17:32 GMT
source-age: 0
content-length: 50517```

from cssstats.

kolaente avatar kolaente commented on June 12, 2024

@johno I've change the ending to .css but the gist still returns text/plain for the header:

$ curl -I https://gist.githubusercontent.com/kolaente/7c3e8e7c91f0409c2fed2182ee547605/raw/a094fd59d63e96447360a87cbac78178aae94775/styles.css                                
HTTP/2 200 
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: "fc09f93056511600514aa9727f872a9d4229914bd6602d911bb7260866fc0ad9"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 1A8E:728B:79039A:7E2589:606E25C5
accept-ranges: bytes
date: Wed, 07 Apr 2021 21:36:05 GMT
via: 1.1 varnish
x-served-by: cache-fra19165-FRA
x-cache: MISS
x-cache-hits: 0
x-timer: S1617831366.578418,VS0,VE186
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
x-fastly-request-id: 12b82f7e352f789c8c3418970e4a2fe7d3e778c1
expires: Wed, 07 Apr 2021 21:41:05 GMT
source-age: 0
content-length: 50517

So I guess the bug actually is in cssstats somewhere?

from cssstats.

kolaente avatar kolaente commented on June 12, 2024

The site itself is (not yet) live by the way which is the reason why I can't just use a public accessible css file somewhere. (ofc I could try to host it properly somewhere else but the gist was the quickest way to check for me).

from cssstats.

kolaente avatar kolaente commented on June 12, 2024

Just checked on cssstats.com with the .css file and it doesn't seem to care for the ending which supports the thesis with the content-type.

from cssstats.

johno avatar johno commented on June 12, 2024

Yeah I think at some point we should prioritize adding in a CSS input so folks with files that aren't publicly hosted have the ability to still get the stats back. But right now we don't support that unfortunately.

Related to #294

from cssstats.

kolaente avatar kolaente commented on June 12, 2024

Do you think it could be an easy enough fix to make the parser ignore the content type?

from cssstats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.