Commit Graph

4262 Commits

Author SHA1 Message Date
Emily Stark
c044786e2f nim, glasser comments 2014-05-08 12:12:45 -07:00
Emily Stark
a8673d01cd Set X-Content-Type-Options in browser-policy-content 2014-05-08 12:12:45 -07:00
Emily Stark
4afa54ca5a Set Content-Type header on js and css resources. 2014-05-08 12:12:45 -07:00
David Glasser
27d9959326 Add missing amplify -> jquery dependency
Somehow this worked in 0.7.2 but starting at 0.8.0 amplify has a
ReferenceError.

Fixes #2113.
2014-05-07 18:04:29 -07:00
Felix Rabe
3431c66c16 Fix occurrences of "cd dirname $0"
They are not safe for spaces in paths. There might be other places to look for trouble.

I've run the following command to produce this commit: (on OS X, copy-and-pasting the below exactly)

    find . -type f -name '*.sh' -print0  |  # Find all .sh files
        xargs -0 fgrep -H -- '`'         |  # See all places with backticks in them
        fgrep 'cd `dirname $0'           |  # I deemed these problematic (variable assignments are safe)
        cut -d ':' -f 1                  |  # Take the <file> from <file>:<line> produced by "grep -H"
        tr '\n' '\0'                     |  # Also here, spaces can be problematic - always do "xargs -0"!
        xargs -0 -- sed -i '' 's/cd `dirname $0`/cd "`dirname "$0"`"/g'

The significance of adding the two levels of "'s can be verified by running the following in your Terminal:

    $ node -e 'console.log(process.argv.splice(1))' -- `echo 1   2`
    [ '1', '2' ]

    $ node -e 'console.log(process.argv.splice(1))' -- "`echo 1   2`"
    [ '1 2' ]

    $ node -e 'console.log(process.argv.splice(1))' -- "`echo "1   2"`"
    [ '1   2' ]
2014-05-07 17:51:09 -07:00
David Glasser
50b7f12922 Fix 0.8.1 regression in ROOT_URL with path
Fixes #2109.
2014-05-07 17:46:08 -07:00
David Glasser
08cf1e0974 shrinkwrap update from 314c8a1
Apparently not passing --force to npm install also allows us to do a
better job of not bundling duplicate npm packages.
2014-05-07 17:31:29 -07:00
Avital Oliver
e5b5858203 Fix flakiness in "defer in rendered callback" test
It was flaky before because template rendered callbacks get called
after flush time, but not if the template got destroyed in the meanwhile.

The way this test was written, if the client managed to respond to the server
rejecting the method before the client's flush cycle, the rendered callback
would never fire. Thus it would hang, since that callback was wrapped
in an expect.

Now we define a method on the client only, which makes it run as a stub
without the server rejecting the method (ever).
2014-05-06 20:24:57 -07:00
Emily Stark
0c479a238b Add credential secret argument to retrieveCredential functions.
Fixes #2118.
2014-05-05 20:51:15 -07:00
David Glasser
9187c554c0 Ban inserting EJSON custom types as documents
Follow-up to 63b3119; further addresses #2095.

There were a few problems here:

- We didn't check that the argument to insert was a document.  (EJSON
  custom types don't count as documents, because they don't have _ids!)

- The check to see if something coming from the database was an EJSON
  custom type didn't match the check in ejson.js (specifically, it was
  missing size===2). This made it sort of look like you could use EJSON
  custom types as top-level documents, until a change in the MongoDB
  driver made made that coincidental almost-working code stop working.

- The replaceNames function wasn't documented as only taking pure JSON,
  so it wasn't obvious that "it throws when there's a Buffer" was a bug
  in the caller rather than a bug in replaceNames.

This should all be resolved now.  Use cases like CollectionFS which were
mislead by these bugs into believing that an EJSON custom type could be
a document should move their custom type into a field.
2014-05-01 13:57:35 -07:00
Emily Stark
de9188f1e8 Merge branch 'master' into devel
Conflicts:
	History.md
	packages/minifiers/urlrewriting-tests.js
2014-05-01 12:39:33 -07:00
Emily Stark
d59f026363 Remove stray console.log in test 2014-05-01 12:17:06 -07:00
Emily Stark
63b3119127 Treat Buffers as Arrays when rewriting MongoDB atoms.
mongodb 1.4.0-rc9 has a `binId` field of type Buffer on ObjectIDs, which
caused Meteor to crash when retrieving a document that was made up of
just an EJSON user-defined type. (Which should not necessarily be
supported, but `replaceNames` should probably treat Buffers as Arrays
regardless.)

Fixes #2095.
2014-05-01 11:49:07 -07:00
David Glasser
1d4004650f Follow-up to 4777e64: fix client-specified _id
This was a regression in 0.8.1 which caused client-specified `_id` to
always be ignored for collections with at least one allow/deny rule.

Fixes #2097. Fixes #2099.
2014-05-01 00:17:11 -07:00
Andrew Wilcox
482d9a78d7 Fix serializing server tests.
`Tinytest.add` is now implemented in terms of `Tinytest.addAsync`, and
the old `async` flag removed.
2014-04-30 23:32:24 -07:00
Andrew Wilcox
853aa3f1d5 Run server tests one at a time. 2014-04-30 23:32:24 -07:00
Slava Kim
d1b58e57dd Fix a typo in test descr 2014-04-30 23:29:23 -07:00
David Glasser
5e0845a436 Follow-up to 4777e64: fix client-specified _id
This was a regression in 0.8.1 which caused client-specified `_id` to
always be ignored for collections with at least one allow/deny rule.

Fixes #2097. Fixes #2099.
2014-04-30 23:01:53 -07:00
Emily Stark
673a285dfc Allow undefined values in Collection.find options check.
At some point we might want to just make `Match.Optional` accept
explicit undefined values in objects, but that will take a little more
thought.
2014-04-30 15:53:59 -07:00
Emily Stark
671e526bc2 Fix test for #2093 2014-04-30 14:45:59 -07:00
Emily Stark
09f7cff076 Fix test for #2093 2014-04-30 14:45:20 -07:00
Avital Oliver
05c7a1662c Test for #2093 2014-04-30 14:32:36 -07:00
Avital Oliver
87510807e8 Try to fix #2093 2014-04-30 14:32:24 -07:00
Avital Oliver
e117e70255 Test for #2093 2014-04-30 14:03:36 -07:00
Avital Oliver
7c813691f2 Try to fix #2093 2014-04-30 11:55:45 -07:00
Emily Stark
b37fd2af7e Merge branch 'master' into devel 2014-04-30 11:03:19 -07:00
Emily Stark
cb6113170f Generate a fresh secret at end of OAuth, and require that secret on login.
Ensures that only the user who completed the OAuth flow can log in over DDP.
2014-04-30 10:08:16 -07:00
Emily Stark
30b937365f Use Random.id() for meetup state parameter.
For some reason meetup converts underscores to spaces in the state
parameter.
2014-04-29 19:56:11 -07:00
Dan Dascalescu
64e02f2f56 Pass failure message for test.length() 2014-04-29 16:49:48 -07:00
David Glasser
e7f955f809 Fix accidental QUERYING->STEADY transition
Fixes "Exception in defer callback: Error: Phase unexpectedly STEADY"
error
2014-04-29 15:00:55 -07:00
David Glasser
2b8f2cc566 Handle token observe better with overlapping login
Before this, we could see the "non-null user observe" error if:

- One login method ran (eg login) and it called _setLoginToken.
  It stored null in userObservesForConnections and gets to the
  defer/observe part
- Another login method ran (eg getNewToken) and it called
  _setLoginToken. The call to removeTokenFromConnection at the top
  clears the null from userObservesForConnections, and it then
  stores its own null in userObservesForConnections, and defers
- One of them finishes the observe and puts its observe in
  userObservesForConnections, overwriting the null which it thinks
  is its alone
- The other one gets there and throws

Also, consistently use _.has when checking if userObservesForConnections
has an element.
2014-04-29 14:30:34 -07:00
Avital Oliver
9ab335baff Fix consistent id tests on IE8
IE8 doesn't support `func.name`
2014-04-29 13:59:51 -07:00
Emily Stark
31a9b47bc6 Don't set img tags to javascript: URLs in tests in IE.
IE throws an exception if you set an img src to a javascript: URL.
2014-04-28 20:51:49 -07:00
Emily Stark
8b634a96f9 Wait for sub ready on another mongo-livedata test 2014-04-28 16:23:42 -07:00
Avital Oliver
2fdae0f132 Wait for subscription ready on another mongo livedata test 2014-04-28 16:11:53 -07:00
Emily Stark
6ce2c131d3 Fix some mongo-livedata tests 2014-04-28 16:04:50 -07:00
Avital Oliver
5a646fe796 Work towards better mongo-livedata tests.
We should always wait for subscription to be ready
before calling methods if we expect to be able to read
the database within a method callback
2014-04-28 16:03:55 -07:00
Avital Oliver
d45414154d Simplify mongo-livedata id generation tests 2014-04-28 13:54:08 -07:00
Avital Oliver
e48a3e557f Fix IE8 "table assembly" test failure.
We no longer automatically wrap table elements in
a <tbody>.
2014-04-28 12:17:00 -07:00
Avital Oliver
dd7d8fea60 Fix consistent id tests.
We now wait for subscriptions to be ready before calling
methods that affect those collections. Otherwise, when the
callback fires the documents in those collections aren't
guaranteed to be available on the client.
2014-04-25 18:54:52 -07:00
Avital Oliver
e4c17ef07b Isolate consistent id generation tests 2014-04-25 18:50:16 -07:00
David Greenspan
788b5254fb Address Blaze XXXs in History.md 2014-04-24 22:00:20 -07:00
Emily Stark
9b41237f69 One last little tweak to javascript: error message 2014-04-24 18:58:41 -07:00
Emily Stark
ff7fc769d9 Tweak javascript: attribute value error message. 2014-04-24 18:55:54 -07:00
Emily Stark
ef2412dcec Suppress logs on javascript: attribute tests 2014-04-24 17:45:01 -07:00
Emily Stark
6b67cd0449 Catch errors in _storePendingCredential to avoid crashing runner 2014-04-24 16:33:11 -07:00
David Glasser
4777e64336 Don't pass server-generated _id to allow/deny
This lets you still use C.insert from the client but reject arbitrary
client-set _id's (as opposed to _id's generated using the Random.id()
algorithm with a client-determined _id).

If you don't want clients to be able to have any control over the _id at
all for inserts, then you'll have to forbid all direct inserts and use
your own methods which explicitly do `C.insert({_id: Random.id(), ...})`

Note that allow/deny rules with transforms still see an _id, because
transforms need to have (and preserve) _id.  This means that if you
really want to see the server-generated _id, you can just specify an
identity transform for your allow/deny rule.
2014-04-24 14:01:39 -07:00
David Glasser
41b5b95b38 testAsyncMulti: Include block index in failures 2014-04-24 14:01:34 -07:00
Emily Stark
9fb63da3c7 Handle unexpected keys for pending OAuth credentials.
Duplicate keys aren't expected, but in case something weird happens,
just override the previous information associated with that key. We
simply insert nothing for non-string keys (e.g. an OAuth flow with no
`state` parameter, which should never happen normally).
2014-04-24 10:06:39 -07:00
Nick Martin
a496fcab4c one more comment. 2014-04-23 19:37:03 -07:00