Code Monkey home page Code Monkey logo

Comments (6)

nlfurniss avatar nlfurniss commented on July 16, 2024

I just tried this, and the url returned in the Response is the correct one.

fetch('https://www.mocky.io/v2/5a8520933000006e0069b0fa', {
  method: 'POST'
})
.then(response => console.log(response));
// Response object
body: (...),
bodyUsed: false,
headers: Headers {},
ok: true,
redirected: true,
status: 200,
statusText: "OK",
type: "basic",
url: "https://www.mocky.io/"

That test url is set to return mocky.io as the Location

Are there any other important details?

from ember-fetch.

n1klu5 avatar n1klu5 commented on July 16, 2024

Using exactly the same code you pasted

fetch('https://www.mocky.io/v2/5a8520933000006e0069b0fa', {
  method: 'POST'
})
.then(response => console.log(response));

We get the response using ember-fetch

//Response object
headers: Headers {map: {…}}
ok: true
status: 200
statusText: "OK"
type: "default"
url: ""
_bodyInit "↵↵↵↵<!DOCTYPE html>↵↵<html>↵  ..."
_bodyText"↵↵↵↵<!DOCTYPE html>↵↵<html>↵  ..."
__proto__: Object

Are you sure you used ember-fetch? Because your response object looks like response from standard fetch not like the one from ember-fetch

from ember-fetch.

nlfurniss avatar nlfurniss commented on July 16, 2024

I am sure, as I added that code to ember-fetch's dummy app. Here is a screenshot of it hitting the polyfill:

image

And the response, complete with url:
image

from ember-fetch.

n1klu5 avatar n1klu5 commented on July 16, 2024

OK, thank you for your input, you made me think :)
It looks like pretender (ember-cli-mirage is based on) is doing the bad work

from ember-fetch.

nlfurniss avatar nlfurniss commented on July 16, 2024

@tomasz-szymanek is your issue in app code or tests?

from ember-fetch.

tomasz-szymanek avatar tomasz-szymanek commented on July 16, 2024

As @n1klu5 said - it wat mirage all along :) Thanks for your time!

from ember-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.