passing a custom namespace binding will not work #67
Description
at the moment in the code we provide an option to set a custom ASSET_NAMESPACE binding, but it appears that we actually never use it.
If we want this option to work, we need to test and verify the following scenarios:
- Proof of the bug: Define a kv namespace for both CUSTOM_NAMESPACE and __STATIC_CONTENT. Pass CUSTOM_NAMESPACE in to the function as options.ASSET_NAMESPACE. You would expect to get back the result from CUSTOM_NAMESPACE, but you will actually get back the result from __STATIC_CONTENT.
My working hypothesis is that if the global __STATIC_CONTENT is undefined, this will actually throw an undefined exception in the current code.
-
I fail to bind anything to the global variable CUSTOM_NAMESPACE, and pass it in as part of the options object under ASSET_NAMESPACE. The kv asset handler should throw an InternalError when it does the typeof check against ASSET_NAMESPACE. I believe this happens with the code right now.
-
(Control test): I bind a kv namespace to the global __STATIC_CONTENT and do not pass anything in to the options object. The kv asset handler should call .get on the static content object and return the result.
-
Proof the bug is squashed: run test Remove condition and class - export a single function #1 above. You should get back the response from the CUSTOM_NAMESPACE.