ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

URL shortener does not return UUID #124

Closed escondida closed 9 years ago

escondida commented 9 years ago

When shortening a URL with, say, curl -F 'c=http://somelongwebsite.com' https://ptpb.pw/u pb returns only the shortened URL, not a UUID for later updates/removal as normal.

buhman commented 9 years ago

Shorturls don't support updates--showing the UUID is only half the problem.

Updates only make sense for vanity pastes, as shortIDs are derived from the sha1 of the content. Even if I did make PUT do the right thing for shorturls, you might as well just POST as the end result is roughly equivalent. See #122.

I could be persuaded to refactor pb in either direction with sufficient justification--what's your use case?

escondida commented 9 years ago

Interesting. That definitely makes sense. It might be good to return the UUID if only for the sake of deleting the associated paste...but on the other hand, I suppose that even a long URL doesn't exactly waste too much server space for the host.

buhman commented 9 years ago

Not a bug.