gaukas / clienthellod

TLS ClientHello/QUIC Initial Packet reflection service
https://client.tlsfingerprint.io
Apache License 2.0
15 stars 2 forks source link

Fixes #13 - AppIsConfigured to AppIfConfigured #14

Closed cowsay closed 1 year ago

cowsay commented 1 year ago

Also encountered this error so i changed to nil check instead of bool


/root/4/clienthellod/modcaddy/listener/listener.go:65:6: invalid operation: operator ! not defined on ctx.AppIfConfigured(app.CaddyAppID) (value of type any)
# github.com/gaukas/clienthellod/modcaddy/handler
/root/4/clienthellod/modcaddy/handler/handler.go:53:6: invalid operation: operator ! not defined on ctx.AppIfConfigured(app.CaddyAppID) (value of type any)```
cowsay commented 1 year ago

Fixes #13

gaukas commented 1 year ago

It might be better if you'd love to update the dependencies in go.mod (I guess that's why to Go build has failed). Or I can do that if it is inconvenient for you.

gaukas commented 1 year ago

And I'd suggest just combine the App() call with AppIfConfigured():

if app := AppIfConfigured(...); app == nil {
    // ...
} else {
    // ...
}

Since it is returning the App if it is configured.

gaukas commented 1 year ago

Oof. Seems like the latest Caddy does not support Go 1.20 am I right? Or something else happened.

gaukas commented 1 year ago

I see. Updating transitive dependencies breaks caddy. Bummer. People love breaking changes without new major version.

gaukas commented 1 year ago

Huzzah.