ktorio / ktorio/ktor

Ktor Client JS: request to /example requests http://localhost/example

Open
#1,695 5 comments 2 reactions 1 assignee View on GitHub

@e5l is already working on this.

Since Mar 2, 2020.

bug
Dominant language
Kotlin
Stars
14.5k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
49

Description

Ktor Version and Engine Used (client or server and name)
Ktor Client Common 1.3.1, in browser (JS)

Describe the bug
request to /example requests http://localhost/example

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/Ribesg/Kita/tree/2c7941183ebcde1fc2193bd00a1bed53f1249b10 on a machine which can be reached from the network (a server)
    git clone https://github.com/Ribesg/Kita
    cd Kita
    git reset --hard 2c7941183ebcde1fc2193bd00a1bed53f1249b10
    
  2. Run ./runServer.sh
  3. Browse to https://yourserver:12345
  4. Try to login using whatever credentials (correct ones are admin/admin)
  5. See failing requests to https://localhost/api/auth/login instead of https://yourserver:12345/api/auth/login in the console

Expected behavior
Requests should use the current location.origin when none is provided in the browser

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.