jagregory / halgo

HAL implementation in Go
MIT License
33 stars 9 forks source link

Headers #10

Open xogeny opened 9 years ago

xogeny commented 9 years ago

When dealing with APIs that require headers (e.g., the Authorization header), it is useful to be able to inject those headers. Currently, halgo doesn't seem to provide a way to do that.

I've actually added that functionality and I can submit a PR. But it would be best if my other PRs were accepted first because this functionality is getting intertwined with those and it isn't really practical to provide a PR for just this functionality without inadvertently and indirectly sucking in the other stuff.

My PR includes support for establishing "global" headers that should be included in all requests and headers that should be applied only to specific steps.

xogeny commented 9 years ago

Anybody who wants access to this functionality can find it on my master branch at https://github.com/xogeny/halgo. The README.md describes the functions for manipulating headers in a chain. Hopefully this will land in the upstream version at some point.

jagregory commented 9 years ago

Other pull requests merged, feel free to send some more my way.

jhiemer commented 9 years ago

Are those changes merged? I get a halgo.Navigator("http://localhost:8080/service").SetSessionHeader undefined (type halgo.navigator has no field or method SetSessionHeader)

xogeny commented 9 years ago

It does not appear to be merged. You can find the changes in my headers_support branch (I think).

It seems I never submitted a pull request for it. I don't have time to look into why that was. I suspect it is mainly because the PRs were (for a while) pilling up and it was getting a bit hard to keep track of them all (because new ones were increasingly depending on old ones). Now that the backlog is cleared, I should be able to submit more. But not just yet.

https://github.com/xogeny/halgo/tree/header_support

jhiemer commented 9 years ago

Ok, understood. Currently I am using your repository @xogeny, as it contains those merges. So best way would be forking your repo and keep on working with that, because this one here is not really maintained?

xogeny commented 9 years ago

In the short term, feel free to use mine. I don't want to have to maintain my own fork and I don't think it is accurate that this one isn't really maintained. Everybody has a "day job" to deal with (including me). I'll try to find some time to put together a pull request for this stuff. I can't really complain about the headers stuff not being merged...I never submitted a PR.

So hopefully these changes will make it into the main repo at some point soon.

jagregory commented 9 years ago

Apologies for letting the previous PRs languish for so long, they came at a very busy time for me :)

If you send another one across I'll get it in asap.

On Tue, Mar 31, 2015 at 4:47 AM, Michael Tiller notifications@github.com wrote:

In the short term, feel free to use mine. I don't want to have to maintain my own fork and I don't think it is accurate that this one isn't really maintained. Everybody has a "day job" to deal with (including me). I'll try to find some time to put together a pull request for this stuff. I can't really complain about the headers stuff not being merged...I never submitted a PR.

So hopefully these changes will make it into the main repo at some point soon.

— Reply to this email directly or view it on GitHub https://github.com/jagregory/halgo/issues/10#issuecomment-87768357.

James Gregory

Tel: +61 (0) 411 619 513 Website: http://jagregory.com Twitter: @jagregory http://twitter.com/jagregory