Skip to content

Commit

Permalink
Merge pull request #144 from isucon/display_name_for_php
Browse files Browse the repository at this point in the history
PHPでは同一パラメータ名を配列で受け取るときに[]を付ける必要がある
  • Loading branch information
fujiwara authored Jul 6, 2022
2 parents 254cc23 + a158c94 commit bbeaeb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bench/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func GetOrganizerPlayersListAction(ctx context.Context, ag *agent.Agent) (*http.
func PostOrganizerPlayersAddAction(ctx context.Context, playerDisplayNames []string, ag *agent.Agent) (*http.Response, error) {
form := url.Values{}
for _, displayName := range playerDisplayNames {
form.Add("display_name", displayName)
form.Add("display_name[]", displayName)
}
req, err := ag.POST("/api/organizer/players/add", strings.NewReader(form.Encode()))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion webapp/go/isuports.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ func playersAddHandler(c echo.Context) error {
if err != nil {
return fmt.Errorf("error c.FormParams: %w", err)
}
displayNames := params["display_name"]
displayNames := params["display_name[]"]

pds := make([]PlayerDetail, 0, len(displayNames))
for _, displayName := range displayNames {
Expand Down

0 comments on commit bbeaeb9

Please sign in to comment.