Skip to content

The DefaultRequest feature overwrites any user specific data #877

Open
@ansman

Description

@ansman

Ktor Version

1.1.1

Ktor Engine Used(client or server and name)

N/A

JVM Version, Operating System and Relevant Context

N/A

Feedback

When using the DefaultRequest feature it prevents the caller being able to specify its own values.

For example if you do this:

defaultRequest {
  url {
    host = "example.com"
  }
}

all requests will always be against the host example.com even if a user does this:

client.call(Url("https://google.com/foo"))

If anything the name of the feature is misleading and should perhaps be called AllRequests instead.

This is especially hard since a lot of properties in Url have default values of their own so it's hard to know if they have been set explicitly or not.

Metadata

Metadata

Assignees

Labels

uxUser Experience issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions