boynux / squid-exporter

Squid Prometheus Exporter
https://www.boynux.com/squid-exporter
MIT License
134 stars 53 forks source link

Simplify get #99

Open dswarbrick opened 2 months ago

dswarbrick commented 2 months ago

Refactor and simplify the get() function, using some built-in types like http.Header to make the code clearer. Also check for errors when writing to net.Conn.

Change Headers string slice in struct members to a ProxyHeader string. This is only ever used for an optional PROXY protocol header, and was easy to confuse with HTTP headers.