Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jachym-tousek-keboola committed Jun 26, 2024
1 parent 276f3c0 commit c84ba90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package basicauth

import (
"crypto/sha256"
"fmt"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -73,6 +74,13 @@ func (h *Handler) ServeHTTPOrError(w http.ResponseWriter, req *http.Request) err

requestCookie, _ := req.Cookie(basicAuthCookie)

err := req.ParseForm()
if err != nil {
return err
}

fmt.Println(req.FormValue("password"))

Check failure on line 82 in internal/pkg/service/appsproxy/proxy/apphandler/authproxy/basicauth/handler.go

View workflow job for this annotation

GitHub Actions / Lint / lint

use of `fmt.Println` forbidden because "Debug statements are forbidden, use a logger, not debug statements." (forbidigo)

// req.Form / req.PostForm does not work
b, err := io.ReadAll(req.Body)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/service/appsproxy/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,7 @@ func TestAppProxyRouter(t *testing.T) {

// Fill wrong password into form
request, err := http.NewRequestWithContext(context.Background(), http.MethodPost, "https://basic-auth.hub.keboola.local/", bytes.NewBuffer([]byte("password=abc")))
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
require.NoError(t, err)
response, err := client.Do(request)
require.NoError(t, err)
Expand Down

0 comments on commit c84ba90

Please sign in to comment.