SherClockHolmes / webpush-go

Web Push API Encryption with VAPID support.
MIT License
312 stars 67 forks source link

HTTPClient --> httpClient in Options prevents customizing the client #18

Closed solarfly73 closed 5 years ago

solarfly73 commented 5 years ago

I was setting the HTTPClient to provide a client that had a transport and client pool controlled by my code, and would pass this client into webpush.Options. Is there a reason this got lower-cased? Can a method be provided to override the transport? The problem later occurs in SendNotification:

    // Send the request
    if options.httpClient == nil {
        options.httpClient = &http.Client{}
    }

So now, every time a push is initiated a new client is created instead of taking an established client.

SherClockHolmes commented 5 years ago

@solarfly73 Sorry about that. I was under the impression that no one would use the http client option. I'll add that back in.

SherClockHolmes commented 5 years ago

@solarfly73 Thanks for the ticket, please upgrade to v1.0.1. https://github.com/SherClockHolmes/webpush-go/releases/tag/v1.0.1