Skip to content

httpdebug feedback #7

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

Open
wants to merge 1 commit into
base: logger_debugger
Choose a base branch
from

Conversation

VojtechVitek
Copy link

No description provided.

@VojtechVitek VojtechVitek changed the base branch from master to logger_debugger June 4, 2025 21:22
@VojtechVitek VojtechVitek changed the title logger, debugger httpdebug feedback Jun 4, 2025
Copy link
Contributor

@david-littlefarmer david-littlefarmer left a comment

Choose a reason for hiding this comment

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

Looks good, this approach is better then client.
2 small comments/thoughts.


type ctxKey struct{}

func isDebugModeEnabled(ctx context.Context) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep it exported, so we can use it anywhere we want.

Suggested change
func isDebugModeEnabled(ctx context.Context) bool {
func IsDebugModeEnabled(ctx context.Context) bool {


// Header represents a special header that enables debug mode.
type Header struct {
Key string `toml:"key"`
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more straigtforward.

Suggested change
Key string `toml:"key"`
Header string `toml:"header"`

Value is beter then password 👍

Copy link
Author

Choose a reason for hiding this comment

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

They call it Key+Value in Go http.Header methods:

https://pkg.go.dev/net/http#Header.Add

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

Successfully merging this pull request may close these issues.

2 participants