Skip to content

Stringify objects when posting a form-encoded body#1401

Merged
mdellweg merged 1 commit into
pulp:mainfrom
mdellweg:html_form_encode
May 27, 2026
Merged

Stringify objects when posting a form-encoded body#1401
mdellweg merged 1 commit into
pulp:mainfrom
mdellweg:html_form_encode

Conversation

@mdellweg
Copy link
Copy Markdown
Member

No description provided.

@mdellweg mdellweg force-pushed the html_form_encode branch 5 times, most recently from 99ad0ff to 6fde5c6 Compare May 20, 2026 12:30
@mdellweg mdellweg marked this pull request as ready for review May 20, 2026 13:25
if isinstance(body, dict):
data = {k: encode_stringify(v) for k, v in body.items()}
else:
data = encode_param(body)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if body is a list of dicts? Is this possible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not yet in our api. And I'd need to reread the specification in that case.

from pulp_glue.common import oas
from pulp_glue.common.exceptions import SchemaError, ValidationError
from pulp_glue.common.schema import (
encode_html,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you going to add a test for encode_stringify?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can, I guess...

@mdellweg mdellweg force-pushed the html_form_encode branch from 6fde5c6 to 2bbe681 Compare May 21, 2026 07:52
@mdellweg mdellweg force-pushed the html_form_encode branch from 2bbe681 to 7928b31 Compare May 21, 2026 10:39
@mdellweg mdellweg requested a review from gerrod3 May 21, 2026 13:32
@mdellweg mdellweg merged commit 52254cd into pulp:main May 27, 2026
17 checks passed
@mdellweg mdellweg deleted the html_form_encode branch May 27, 2026 14:04
@patchback
Copy link
Copy Markdown

patchback Bot commented May 27, 2026

Backport to 0.39: 💚 backport PR created

✅ Backport PR branch: patchback/backports/0.39/52254cde1ff29e737c31d142cd99bcb6ee645d38/pr-1401

Backported as #1405

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants