Comments (10)
So I found two issues, both on github's end. (though both I could workaround if needed).
- If you override the
Agent
header to be what the git cli tool sends (git/1.8.1.2
instead ofjsgit/0.2.3
), it will give a redirect instead of a 404 - It redirects. I haven't implemented redirect following because url parsing isn't cross-platform yet. Why don't they provide the proper url for you to clone?
If you clone using the proper url, it works fine, even without changing away from my custom agent header.
TRACE=1 jsgit clone http://gist.github.com/gist/036c175d18a8a692a89d.git milestones
Notice the /gist/
at the front of the path.
from js-git.
So: What are you using for the redirections and how can I help to solve the cross-platform issue? Where should be implemented and what should I be looking for?
from js-git.
So for redirects, I just need more logic in smart-http. But the problem with url parsing is I'm using the "url" module from node.js. In http redirects it gives the new url as a string, but smart-http works in terms of already parsed urls.
There is a strict line between what's allowed to be used in js-git proper and what js-git-node-platform can use. Anything exported by the platform can be used by js-git, but that then means all ports of the platform have to implement that interface as well.
Urlparse is pure javascript. Maybe we could just include the source from node.js in the browser ports and make it part of the platform interface?
from js-git.
Component has a really interesting implementation of parsing urls in the browser.
from js-git.
Actually, since the node url parser doesn't work for all git urls anyway, (It can't handle urls like [email protected]:user/repo.git
), I should just include the url parser in helpers/urlparse.js
.
from js-git.
Might be able to steal some of the logic from @visionmedia's https://npmjs.org/package/github-url-from-git
from js-git.
wrt. the first Github issue (the one based on the user-agent), is js-git sending the appropriate Content-Type (application/x-git- something)? I know there's an extant bug ticket for Bitbucket about it (with the author of the Python Git module Dulwich arguing against UA spoofing): https://bitbucket.org/site/master/issue/6666/detect-git-requests-by-content-type-header
from js-git.
@stuartpb yes, I'm sending the proper content type. It's sniffing on the user agent. I'm implementing redirect support and a way to send a custom useragent. That should make it possible to clone from gists.
from js-git.
Added hack in http code for gist. creationix/git-net@708721e
Now to implement redirect...
from js-git.
Done!
creationix/git-net@da8c27d
from js-git.
Related Issues (20)
- Generating repo statistics using js-git HOT 2
- NodeJS Git Server HOT 4
- what is wrong with my syntax?
- repo.unpack callback is never called using HTTP transport HOT 7
- Where can I find examples? HOT 18
- Pull / push HOT 7
- commit.parents is not defined when using logWalk HOT 2
- Octal modes HOT 2
- read ref-delta cause infinite loop... HOT 2
- NPM package is outdated HOT 1
- Example on README doesn't show that the yield loadAs returns an array
- es-git: js-git 2.0 HOT 18
- Clone URL in browser? HOT 10
- pack-ops mixing doesn't work HOT 5
- Replace github-db with private git server? HOT 4
- In-memory file system HOT 2
- resolveRef should be available through a mix-in HOT 2
- Typo in mem-cache dupe?
- support simple HTTP protocol HOT 25
- bountysource.com/fundraisers is dead and the about link is sad HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-git.