You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,44 @@ allow the use of existing libraries.
8
8
9
9
Note: This library currently conforms to [XMLHttpRequest 1](http://www.w3.org/TR/XMLHttpRequest/). Version 2.0 will target [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/).
10
10
11
+
## Difference from original node-XMLHttpRequest ##
12
+
13
+
When a protocol was missing from the [original node-XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest/),
14
+
`localhost` was intended to be assumed and any path determined relative to
15
+
`localhost` root.
16
+
17
+
This fork avoids the need for having a server set up and running, and
18
+
instead assumes a local file.
19
+
20
+
This project aims to ensure that the top-most requiring user-file is
21
+
used for determining the base path (but not relative to unrelated
22
+
higher executables like [nodeunit](https://github.com/caolan/nodeunit). More
23
+
precisely speaking, the relativity of the path will be determined
24
+
relative to the topmost file which meets either of the following
25
+
criteria and is thus assumed to be the topmost user file:
26
+
27
+
1. No `node_modules` folder is present.
28
+
1. The file's nearest "node_modules" ancestor contains our
29
+
node-XMLHttpRequest code (i.e., the user file has XMLHttpRequest as a dependency)
30
+
31
+
This may not be perfect (and alternative ideas are welcome), but it
32
+
is hoped it will allow the likes of `nodeunit` tests to be used with
33
+
portable and easy to follow relative paths (not to mention with the
34
+
possibility of reusing those same tests in the browser via the likes of
0 commit comments