Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Modify locale handling to inspect request parameters #72

@ghost

Description

Description

The default behavior of WordPressComRestApi appends a locale parameter to requests. To do so, it inspects & modifies the path of a given request if needed.

If a caller were to specify locale in the request parameters, however, the specified value is not properly de-duplicated. For example, composing a GET request with the default behavior enabled, passing locale : foo in the request parameters evinces a request with the following URL : https://public-api.wordpress.com/wpcom/v2/<path>?locale=en&locale=foo.

Potential Solution

The client should inspect the parameters associated with the request, and de-duplicate those if necessary. It might be worth using URLComponents for this purpose.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions