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

proxy+auth: fix post request #115

Merged
merged 1 commit into from
May 24, 2024
Merged

proxy+auth: fix post request #115

merged 1 commit into from
May 24, 2024

Conversation

guggero
Copy link
Member

@guggero guggero commented Oct 24, 2023

Fixes #114.

auth/authenticator.go Outdated Show resolved Hide resolved
auth/authenticator.go Outdated Show resolved Hide resolved
@lightninglabs-deploy
Copy link
Collaborator

@guggero, remember to re-request review from reviewers when ready

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

7 similar comments
@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@lightninglabs-deploy
Copy link
Collaborator

Closing due to inactivity

@guggero
Copy link
Member Author

guggero commented Apr 22, 2024

!lightninglabs-deploy mute

@guggero
Copy link
Member Author

guggero commented May 10, 2024

PR could be simplified after #135, now it's just removing the unused parameter and adding a test case.

@guggero guggero requested review from Roasbeef and starius May 10, 2024 13:00
Copy link
Contributor

@starius starius left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Thank you for refactoring it!


require.Equal(
t, fmt.Sprintf("%d", len(bodyContent)),
resp.Header.Get("Content-Length"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Field resp.ContentLength can be used, to avoid using fmt.Sprintf("%d",

Go documentation says:

// When
// Header values are duplicated by other fields in this struct (e.g.,
// ContentLength, TransferEncoding, Trailer), the field values are
// authoritative.

https://pkg.go.dev/net/http#Response

There are two other instances below in the code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, thanks! Fixed.

@guggero guggero merged commit 996f100 into master May 24, 2024
5 checks passed
@guggero guggero deleted the fix-post-response branch May 24, 2024 06:36
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.

POST request with body not working
4 participants