Skip to content

Instantly share code, notes, and snippets.

@danielmoore
Created January 10, 2014 15:40
Show Gist options
  • 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://[email protected]/-/user/org.couchdb.user:isaacs
{"_id":"org.couchdb.user:isaacs","_rev":"93-157a5d9f44f3ef8fe6b21380632becf1","name":"isaacs","email":"[email protected]","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":"[email protected]","title":"Email","show":"<a href=\"mailto:[email protected]\">[email protected]</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://[email protected]/registry/-/user/org.couchdb.user:isaacs
{"error":"not_found","reason":"missing"}
@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