elm / http

Make HTTP requests in Elm
https://package.elm-lang.org/packages/elm/http/latest
BSD 3-Clause "New" or "Revised" License
154 stars 46 forks source link

For `PUT` requests, `Response.url` is `undefined` for IE 11 and Edge <= 13 #39

Open michaelglass opened 6 years ago

michaelglass commented 6 years ago

We saw this in production against IE 11, Edge 12, Edge 13, seems fixed on Edge 14 on Windows 7, 8.1, and Windows 10,

Here's a test case: https://github.com/michaelglass/repro-ie-put-bug/

The result of the Debug.log in the test case above yields:

{ status = { code = 200, message = "" }
, headers = Dict.fromList [("\ncontent-type","application/json; charset=utf-8")]
, url = <internal structure>
, body = "{\"updatedAt\":\"2018-04-05T08:48:49.587Z\"}" 
}

grabbing the output of the raw xhr request from toResponse(xhr) yields:

{
   0: <Unable to get property 'message' of undefined or null reference>,
   __proto__: { },
   DONE: 4,
   HEADERS_RECEIVED: 2,
   LOADING: 3,
   msCaching: "auto",
   onabort: null,
   onerror: null,
   onload: null,
   onloadend: null,
   onloadstart: null,
   onprogress: null,
   onreadystatechange: null,
   ontimeout: null,
   OPENED: 1,
   readyState: 4,
   response: "{"updatedAt":"2018-04-05T08:51:32.200Z"}",
   responseBody: <String expected>,
   responseText: "{"updatedAt":"2018-04-05T08:51:32.200Z"}",
   responseType: "text"
}

I couldn't get Ellie to work with IE11 but the bug reproduces fine from elm reactor.

(tagging @stoeffel as he helped here)

process-bot commented 6 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.