Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set scheme client option #30

Merged
merged 1 commit into from
Jun 29, 2016
Merged

Conversation

aanm
Copy link
Contributor

@aanm aanm commented Jun 29, 2016

Signed-off-by: André Martins aanm90@gmail.com

@@ -603,6 +615,12 @@ func (c *Client) execute(req *Request) (*Response, error) {

req.Time = time.Now()
c.httpClient.Transport = c.transport

if req.RawRequest.URL != nil && req.RawRequest.URL.Scheme == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this complete if condition to middleware.go#L141?

@jeevatkm
Copy link
Member

@aanm Thank you so much for contributing to Resty.

I have added couple of note, can you please have a look and take care? Also test case please for your scenario.

@aanm
Copy link
Contributor Author

aanm commented Jun 29, 2016

@jeevatkm Done

@jeevatkm
Copy link
Member

@aanm Thanks for your effort, I appreciate it. Travis CI check didn't pass, added a not for URL and test case.


SetScheme("http")

assertEqual(t, true, DefaultClient.scheme == "true")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line may be -

assertEqual(t, true, DefaultClient.scheme == "http")

Signed-off-by: André Martins <aanm90@gmail.com>
@aanm
Copy link
Contributor Author

aanm commented Jun 29, 2016

@jeevatkm Fixed

@jeevatkm
Copy link
Member

@aanm Thanks, this is helpful for community.

This allows go-resty to be used with unix sockets.

If you're interested, please add example too for community. I'm glad to this PR and your upcoming examples.

@jeevatkm jeevatkm self-assigned this Jun 29, 2016
@jeevatkm jeevatkm added this to the v0.8 Milestone milestone Jun 29, 2016
@jeevatkm jeevatkm merged commit 45ff948 into go-resty:master Jun 29, 2016
@aanm aanm deleted the add-set-scheme branch June 29, 2016 22:27
@jeevatkm
Copy link
Member

jeevatkm commented Jul 8, 2016

@aanm Would you be interested in providing example for resty with unix socket?

Like creating an example directory and within that resty_unix_socket.go

@aanm
Copy link
Contributor Author

aanm commented Jul 11, 2016

@jeevatkm #32

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

Successfully merging this pull request may close these issues.

2 participants