rgrove / rawgit Goto Github PK
View Code? Open in Web Editor NEWServed files from raw.githubusercontent.com, but with the correct content types. No longer actively developed.
Home Page: https://rawgit.com
License: MIT License
Served files from raw.githubusercontent.com, but with the correct content types. No longer actively developed.
Home Page: https://rawgit.com
License: MIT License
The file links lead to rawgit.com pages when they could lead to raw.githubusercontent.com files instead and save some bytes :p
Please add some cache headers to your responses. If you don't want to make this the default, add a query parameter to allow for caching. But most of the time this is what you really want, so I would make caching the default. Besides, this would ameliorate the load on github.
raw.github.com seems to serve the correct content types for images, so there's no need to proxy those. Should investigate other non-text filetypes as well.
When I access a private raw file in GitHub, GitHub appends a token to the URL so that one can acess it:
https://raw.githubusercontent.com/...?token=...
When I open rawgit URL I get 404. :-(
It seems token is not used/passed on?
I would need this to be able to add SVG images to the README in a private repository.
Since all rawgit.com can only be used by github all we need to do is file an issue under a bot account or send an email.
I like using gist when filing defects for Selenium, so this would be awesome for simplifying my repro scripts!
If you like the idea but don't have time for it, I'll probably take a shot at it.
This is bad
Investigate caching requested resources briefly (perhaps for 5-10 minutes) to avoid making multiple unnecessary requests to raw.github.com
and reduce the impact of upstream timeouts.
Perhaps support a ?nocache
query string flag to allow a cache bypass in the event that someone wants to test a file they've just updated.
For XHTML files the returned content type is text/plain; charset=utf-8
instead of application/xhtml+xml; charset=utf-8
.
For example it doesn't work for this file:
https://raw.githubusercontent.com/w3c/csswg-test/master/css-multicol-1/multicol-nested-002.xht
However it works using the CDN URL it works as expected (thought it's not convenient for my particular use case as the resources are cached):
https://cdn.rawgit.com/w3c/csswg-test/master/css-multicol-1/multicol-nested-002.xht
Currently when you open a symbolic link in rawgithub its path is displayed (example).
A 307 redirection would be much nicer.
I am running my own copy of RawGit and it's great!
The issue I have is that it still says "rawgit.com" everywhere, and that confuses my users. I know that I can just change it everywhere, but that means I'd have to change it again every time that I pull upstream changes.
I think that the solution is to be able to set variables with the names of the domain and the CDN, to make this easier for myself and others like me.
I can do this in a pull request, but I wanted to hear what you think before I put in the time.
hello.
I'm unable to load ajax json request
Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
http://jsfiddle.net/9dysn070/
could you add this CORS header?
Hi, I tried to convert https://github.com/Vdragon/Vdragon_s_License_Templates/blob/217eea4d6e13a5f72eddf1f1a3b22dbdee9e9639/Creative%20Commons/CC%20BY-SA/Resources/Creative%20Commons%20CC-BY-SA%20logo.svg to *rawgit.com URLs but found all %20s been coverted to %2520s and wrong URLs generated.
Mobile browsers especially benefit from this since the user is not given the option to launch google earth otherwise
When I try to request a JSON-LD file like this:
curl https://rawgit.com/dvh/KentekenAPI/master/context.jsonld -k
I get a HTTP 301 Moved Permanently
response redirecting me to the original GitHub raw file URL.
Fetching the original raw file is giving issues with the incorrect Content-Type
and Access-Control-Allow-Origin
headers, hence why I'm using RawGit in the first place.
Does RawGit only support certain file types (JSON-LD not being among them)?
These URLs provide GitHub sign-in or error pages, rather than the standard rawgithub.com 404. There probably needs to be some more validation on what is a valid URL.
I'm happy to write that patch - just seeing if you'd be interested, as per the README :)
Would be great if there was a way to force rawgit to refetch a resource!
https://cdn.rawgit.com/rstacruz/flatdoc/v0.9.0/flatdoc.js returns nothing, but https://rawgit.com/rstacruz/flatdoc/v0.9.0/flatdoc.js is ok.
Is there a way to clear cdn cache ?
Or maybe you could disable cache for empty files ?
@rgrove : If you don't have time to handle this, I'll try to make a pull request asap.
Currently looks like OPTIONS requests are returning 404, instead of allowed access origin etc. headers.
OPTIONS https://rawgit.com/elhigu/opencl-testsuite/master/resultdb/test_results.json 404 (Not Found)
Would be nice if this would work too.
Hi,
Is it possible to link to a file from a private repository trough rawGit? I tested it and included the .../filename.js?token=XXX in the link, but it does not seem to work.
Alexander
ETags are passed through from GitHub correctly, but even when a matching If-None-Match
request header is sent, Nginx seems to ignore it. Need to tweak the Nginx config.
I want share test result in html: https://github.com/Hubbitus/tests/blob/0873d49144278680cd1ce4a6497adafdf6bb4979/bbcp/results/test-rsync-without-z%2Bc.2015-04-21_11:49:02.html
Rawgit generates me https://cdn.rawgit.com/Hubbitus/tests/0873d49144278680cd1ce4a6497adafdf6bb4979/bbcp/results/test-rsync-without-z%252Bc.2015-04-21_11:49:02.html URL which lead to 404 error.
Dev/testing: https://rawgit.com/Hubbitus/tests/0873d49144278680cd1ce4a6497adafdf6bb4979/bbcp/results/test-rsync-without-z%252Bc.2015-04-21_11:49:02.html also fail.
Just a simple bookmarklet to redirect the current repo/file to rawgit.
The usage is quite simple:
Go to any repo where you like to preview a file, and execute the booklet. If the current url is a file, it should open the file directly, otherwise it will ask for a filename.
I've tested it with the following url-usecases:
Ok, enough for now: https://gist.github.com/yckart/5832645
Any thoughts?
I wanted to use rawgit for this file: https://github.com/Stuk/jszip/blob/master/dist/jszip.min.js. Clicking on the "Raw" button triggers a download dialog, so I right-clicked > Copy link location. This gave me this URL:
https://github.com/Stuk/jszip/raw/master/dist/jszip.min.js
I assume this is the correct raw URL. Now, when I paste this URL into rawgit, I get this development URL:
https://rawgit.com/Stuk/jszip/raw/master/dist/jszip.min.js
When I try to load this URL in the browser, I get a 404.
Related: #43
Is there a way to force cdn.rawgit.com to refresh master
?
I think you should update evil.js, as it hasn't been updated for some time now. I also think you should use evil.css again instead of your current whole document rotating technique which is not exactly very subtle. Also, for your evil.html you should link to evil.css instead of evil.js which doesn't really do much in that situation.
Seems like raw.github.com
times out a lot (or maybe they're just throttling us). It'd be cool if rawgithub kept track of timeouts and errors and used this to generate a raw.github.com
"health index" that we could display on the front page.
can you register rawgithubusercontent.com ?
Can you just blacklist the spammer and restore the service? Or, possibly, whitelist our file?
Is there an ETA for having the service back online? If not, do you have any ideas for alternate solutions for hosting static content? We're using GH pages for almost everything, but they don't serve HTML as the right mimetype for us so we still have to use RGH for one particular file.
This is what we get for using RGH in production! Can't say you didn't warn us.
On gist a resource can be retrieved in two ways:
https://gist.github.com/ordiovince/2171446/raw/8318c86b357b6ddbf674ad238b8745d2781cab4b/gistfile1.txt
Test
https://gist.github.com/ordiovince/2171446/raw/gistfile1.txt
Test
On rawgithub only this first url will work
https://rawgithub.com/ordiovince/2171446/raw/8318c86b357b6ddbf674ad238b8745d2781cab4b/gistfile1.txt
Test
https://rawgithub.com/ordiovince/2171446/raw/gistfile1.txt
404 Not Found I dunno what you expected, but it ain't here.
Fetching a file from github through rawgit running on node version 0.10.28 causes a stream error:
_stream_readable.js:664
throw new Error('Cannot switch to old mode now.');
^
Error: Cannot switch to old mode now.
at emitDataEvents (_stream_readable.js:664:11)
at IncomingMessage.Readable.resume (_stream_readable.js:649:3)
at Object._onImmediate (/opt/nodejs/proxy/rawgit/lib/middleware/proxy-path.js:157:18)
at processImmediate [as _immediateCallback] (timers.js:309:15)
The streaming API was redesigned for node v.0.10.x [1] and resume() and pause() are not available if the new non-flowing interface is triggered [2]. The error goes away after commenting out incoming.resume(); on line 157 in proxy-path.js:
// Ensure that the incoming stream is drained once the response is closed.
// Otherwise we can leak Buffers.
finished(res, function () {
/*
incoming.resume(); // causes stream error
*/
});
}
Is there a side effect of commenting out incoming.resume()?
Files within submodules return 404:
https://rawgithub.com/cben/CodeMirror-MathJax/7bfeedfe99d72b44621ba0851e4c5f4e51452565/CodeMirror/lib/codemirror.css
which is unrurprising because raw.github.com also returns 404:
https://raw.github.com/cben/CodeMirror-MathJax/7bfeedfe99d72b44621ba0851e4c5f4e51452565/CodeMirror/lib/codemirror.css
(here CodeMirror/
dir is a submodule)
But they do work on Github Pages (only one level deep), and rawgithub is handy even for Pages-hosted projects to send sombody a demo from a specific version/branch, so it'd be nice if it followed submodules.
P.S. Many thanks for creating and running this service ๐ !
Hello!
Looks like RawGit is not supporting WOFF2 font. It's served with Content-Type:application/octet-stream
instead of application/font-woff2
.
However WOFF is served correctly with Content-Type:application/font-woff
.
I made a gist private (not cuz I really care, but because I don't want random pollution of my public gists with test case repros) but I can't seem to get it to appear with rawgithub. Am I missing something? (the gist: https://gist.github.com/medwards/8ccbbe698a46ec21e48a )
Take a look at https://rawgithub.com/chintanparikh/startup-exchange-web/master/index.html
The "Live for an Idea" should look like:
Hey.. first thanks for this repo. I put this https://cdn.rawgit.com/Jayaramki/display-feed-js/master/js/stackFeedLoader.js link in my blog. If I do edit in my source, It is not updating the source. Is this issue or I missed somewhere else?
I didn't see an offering for a quick dev link peek. I'm using this...
๐ javascript:(function(L){L.href=L.href.replace('raw.githubusercontent','rawgit')}(location));
your service is great. but urls like:
https://cdn.rawgit.com/branderxero/44209619ba485e32d7b3/raw/be86b2237efd035b068652b855fc79cef6161cf5/vim-colors.html
are impossible to remember. i'd be wonderful if you offered a shortened url option. e.g.
https://x.rawgit.com/c1v
Thx for your great job. I really want to use cdn.rawgit.com which is faster than rawgit.com and saves money for you. but it prevent me to use cdn.rawgit.com that there is no way to flash the old content.
so, is there any way to do this?
Will it be a solution that when rawgit.com/a/b/c is visited, cdn.rawgit.com/a/b/c will be updated ?
Resource interpreted as Script but transferred with MIME type application/octet-stream: "https://rawgithub.com/niktrix/profile-life/master/socket.io.js/". mtgox:1
Refused to execute script from 'https://rawgithub.com/niktrix/profile-life/master/socket.io.js/' because its MIME type ('application/octet-stream') is not executable, and strict MIME type checking is enabled.
Try looking at the raw file on github.
Now it look like this
https://raw.githubusercontent.com
time to buy https://rawgithubusercontent.com ?
Can we get added support for Bit Bucket?
My page should have background music which keep repeating. However, it is only played once.
I visited https://cdn.rawgit.com/luochen1990/coffee-mate/v0.11.5/build/global.coffee.js before I push the tag, and got 404 as expected. But after I pushed the tag here, cdn.rawgit.com still returns 404 ...
Is this a bug ? or what can I do for this ?
Hi,
thanks for this wonderful service!
I'm currently getting 200 OK
responses on all my requests, so caching on the client is effectively off. Do you have any ideas why this might be?
eg URL https://cdn.rawgit.com/kriskowal/q/3f62d467cb55efe4e0f53fa880239ab5057990e8/q.js
:host:cdn.rawgit.com
:method:GET
:path:/kriskowal/q/3f62d467cb55efe4e0f53fa880239ab5057990e8/q.js
:scheme:https
:version:HTTP/1.1
accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
accept-encoding:gzip, deflate, sdch
accept-language:en-US,en;q=0.8,de;q=0.6,fr;q=0.4
cache-control:max-age=0
cookie:_ga=GA1.2.547487526.1413531650
user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.50 Safari/537.36
access-control-allow-origin:*
cache-control:max-age=315569000
content-encoding:gzip
content-type:application/javascript; charset=utf-8
date:Mon, 23 Mar 2015 16:03:42 GMT
rawgit-cache-status:HIT
server:NetDNA-cache/2.2
status:200 OK
vary:Accept-Encoding
version:HTTP/1.1
x-cache:HIT
x-content-type-options:nosniff
x-robots-tag:none
Thank you!
A.
Hi,
thanks for this ingenious service! Can you please add support for PDF?
I think its very simple - just add some lines to conf
folder, but it will be easier for you.
Correct mime type is application/pdf
. Now I recieve redirect to raw.github.com which downloads with application/octet-stream.
Thanks
Pavel
It seems the "source host" is hard-coded:
https://github.com/rgrove/rawgit/search?utf8=%E2%9C%93&q=githubusercontent
If it could be configured, it would ease (internal) deployments for other hosts than "normal" github, for example Github Enterprise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.