lbryio / lbry.go

MIT License
29 stars 20 forks source link

Forward real IP in internal-api client calls #72

Closed anbsky closed 5 years ago

anbsky commented 5 years ago

This is to add X-Forwarded-For header for calls originated from lbrytv server so internal-apis can correctly log the original IP of the client accessing lbrytv.

anbsky commented 5 years ago

It would be nice if we could have declared response objects instead of the generic ones. So that we can just use this in a library without much thought. There is overhead in keep the api responses aligned but I think its worth it in the long run and its not that much extra work since there is only one. However, its not required for merging.

I don't disagree but for that the API should be versioned and documented, of which this API is unfortunately neither. In the absence of versioning, a simple removal of field will break the whole chain of clients in a far away code, and we don't want that.

anbsky commented 5 years ago

Also the user object path is hardcoded and I am not sure why. Maybe its a const for some other change?

Fixed.