Skip to content

Instantly share code, notes, and snippets.

@danielmoore
Created January 10, 2014 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmoore/8356567 to your computer and use it in GitHub Desktop.
Save danielmoore/8356567 to your computer and use it in GitHub Desktop.
Weird user path rewrite behavior in npm

Why does this work...

$ curl http://$auth@registry.npmjs.org/-/user/org.couchdb.user:isaacs
{"_id":"org.couchdb.user:isaacs","_rev":"93-157a5d9f44f3ef8fe6b21380632becf1","name":"isaacs","email":"i@izs.me","type":"user","roles":[],"date":"2013-12-25T20:42:32.599Z","fullname":"Isaac Z. Schlueter","fields":[{"name":"fullname","value":"Isaac Z. Schlueter","title":"Full Name","show":"Isaac Z. Schlueter"},{"name":"email","value":"isaacs@izs.me","title":"Email","show":"<a href=\"mailto:isaacs@izs.me\">isaacs@izs.me</a>"},{"name":"github","value":"isaacs","title":"Github","show":"<a rel=\"me\" href=\"https://github.com/isaacs\">isaacs</a>"},{"name":"twitter","value":"izs","title":"Twitter","show":"<a rel=\"me\" href=\"https://twitter.com/izs\">@izs</a>"},{"name":"appdotnet","value":"isaacs","title":"App.net","show":"<a rel=\"me\" href=\"https://alpha.app.net/isaacs\">isaacs</a>"},{"name":"homepage","value":"http://blog.izs.me","title":"Homepage","show":"<a rel=\"me\" href=\"http://blog.izs.me/\">http://blog.izs.me</a>"},{"name":"freenode","value":"isaacs","title":"IRC Handle","show":"isaacs"}],"avatarMedium":"https://secure.gravatar.com/avatar/ddd81d85a2ebe5784b5a190204ed9607?s=100&d=retro","github":"isaacs","homepage":"http://blog.izs.me","twitter":"izs","avatar":"https://secure.gravatar.com/avatar/ddd81d85a2ebe5784b5a190204ed9607?s=50&d=retro","freenode":"isaacs","avatarLarge":"https://secure.gravatar.com/avatar/ddd81d85a2ebe5784b5a190204ed9607?s=496&d=retro","appdotnet":"isaacs","foo":"bar"}

...but this does not?

$ curl http://$auth@isaacs.ic.ht/registry/-/user/org.couchdb.user:isaacs
{"error":"not_found","reason":"missing"}
@isaacs
Copy link

isaacs commented Jan 10, 2014

@danielmoore
Copy link
Author

@isaacs I figured you had a vhost setup to point registry.npmjs.org to isaacs.ic.ht/registry, so those two URLs should be equivalent, yes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment