Skip to content

req_body_form() silently drops duplicate names  #107

@jchrom

Description

@jchrom

In order to POST a form on a website where all the checkboxes have identical names, I need to pass a list with duplicate names. But, the duplicates are silently dropped.

The culprit seems to be .x[names(dots)] <- dots in modify_list().

It could be replaced with something like

.x[names(.x) %in% names(dots)] <- NULL
.x <- c(.x, dots)

which would have the advantage of replacing entire homonym groups, and would pass the current tests for modify_list().

It wouldn't help with the headaches in #95 and # 88 though (I am not sure about the # 88).

For a more systematic solution, how about an additional argument replace = TRUE, or a dedicated req_body_form_modify() so that we can decide whether the body gets replaced instead of combined?

  • req_body_*: replaces entire body, avoiding the modify_list() call
  • req_body_*_modify: combines lists

Metadata

Metadata

Assignees

No one assigned

    Labels

    body 🕺bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions