Skip to content

Parser for x-www-form-urlencoded appends newline to parameter value #4

Description

@pteetor

This code fragment parses a simulated POST request with one parameter. It appears that the parser is appending an unwanted newline (\n) to the parameter value.

fake_post <- fiery::fake_request(
  'http://example.com/test',
  method = "post",
  content = 'id=34632',
  headers = list(
    Content_Type = 'application/x-www-form-urlencoded'
  )
)

post_req <- Request$new(fake_post)
post_req$parse(`application/x-www-form-urlencoded` =
               parse_queryform() )
post_req$body

The output is:

$id
[1] "34632\n"

Notice that the id value has a trailing newline (\n), which seems wrong.

For a two parameters POST, the newline is appended to only the second parameter, not the first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions