Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/001-xml_http_request.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget
@_sendFile data
when 'http:', 'https:'
@_sendHttp data
when null
@_sendRelative data
else
throw new NetworkError "Unsupported protocol #{@_url.protocol}"

Expand Down Expand Up @@ -393,12 +395,18 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget
# XMLHttpRequest#send() implementation for the file: protocol.
#
# @private
_sendFile: ->
unless @_url.method is 'GET'
_sendFile: (data) ->
unless @_method is 'GET'
throw new NetworkError 'The file protocol only supports GET'

throw new Error "Protocol file: not implemented"

# XMLHttpRequest#send() implementation for the relative URLs.
#
# @private
_sendRelative: (data) ->
throw new Error "Relative URLs: not implemented"

# XMLHttpRequest#send() implementation for the http: and https: protocols.
#
# @private
Expand Down