https://kotlinlang.org logo
#server
Title
# server
r

Roman N

12/14/2023, 10:28 AM
hi! How to mock ApplicationCall's hostname in Ktor application? I need to test calls to endpoint with different domain names. When I try to send a request in testApplication now, it fails with exception:
Copy code
io.ktor.server.testing.client.InvalidTestRequestException: Can not resolve request to <http://example.loc>. Main app runs at localhost:80, localhost:443 and external services are
5 Views