ktorio / ktorio/ktor

The DefaultRequest feature overwrites any user specific data

Open
#877 4 comments 3 reactions 1 assignee Claimed by @e5l View on GitHub
ux
Dominant language
Kotlin
Stars
14.5k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
49

Description

### 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:
```kotlin
defaultRequest {
url {
host = "example.com"
}
}
```
all requests will always be against the host `example.com` even if a user does this:
```kotlin
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.