Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

fix script tags with ? after the file name

#118

If you include a script tag like:

Env will try to request "steal.js?steal[app]=callcenter&include[env]=development". The browsers will request "steal.js". Env should be made to mirror this behavior. Thatcher said the best place for this is in Envjs.uri, which should detect if its a file or network protocol. There is currently logic that fixes this problem in src/platform/core/html.js, line 94, but it is commented out: filename = Envjs.uri(script.src.match(/([^\?#]*)/)[1], base );

Reported by Brian Moschel · March 17th, 2010 @ 08:24 PM

State: resolved
Milestone: none
Assigned to: nickg nickg

Activity

  1. nickg
    nickg

    Hi Brian,

    I'll work on this for you since I'm just reworking Envjs.uri anyways. Right now it doesn't handle relative paths very well nor javascript: based urls. So I'll your issue to the pile. Might want to follow ticket #115 Cleanup of Envjs.uri as well.

    The script tag you posted got mangled by lighthouse. Can you repost the src? (I'm sure I can figure it out, but...).

    --nickg

    March 18th, 2010 @ 04:52 AM

  2. Brian Moschel
    Brian Moschel

    Thanks Nick,

    Here is that script tag:

    <script type='text/javascript' src='steal.js?steal[app]=myapp&steal[env]=development'></script>
    

    March 18th, 2010 @ 05:06 AM

  3. nickg
    nickg

    hi again,

    and in this case you are loading the original document as a file, not http? (just checking)

    March 18th, 2010 @ 05:40 AM

  4. Brian Moschel
    Brian Moschel

    Actually I'm not sure. I'm invoking Envjs with a relative URL like this:

    Envjs('callcenter/funcunit.html')
    

    March 18th, 2010 @ 06:17 AM

  5. Thatcher
    Thatcher

    This would imply use of the file:// protocol. Are you wanting to load from
    a server via http? I use envjs for both but we do have general issues with
    the query string messing stuff up when accessing local files ie java will
    throw an exception if you try to open

    window.location = 'file:///tmp/foo.html?bar';

    So even if we strip them off before accessing the file, the
    window.location.query would now have the expected value. Just something to
    keep in mind as we try to iron out the Envjs.uri issues.

    March 18th, 2010 @ 06:59 AM

  6. nickg
    nickg

    hola,

    You can pull this in, and you should be able to move forward, however it's not the final patch.

    http://github.com/client9/env-js/commit/3fbc94d726681ca9d843ccb5972...

    I'll need chris's help on making the final patch.

    --nickg

    March 18th, 2010 @ 06:21 PM

  7. nickg
    nickg

    of course the one thing I didnt unit-test had a bug.

    I'm not really sure how to tell you the best way to grab my copy of src/platform/rhino/xhr.js.

    Cut-n-Paste with
    http://github.com/client9/env-js/blob/master/src/platform/rhino/xhr.js

    You can apply the following patches
    http://github.com/client9/env-js/commit/3fbc94d726681ca9d843ccb5972...
    http://github.com/client9/env-js/commit/560757564062f8bc5468472d95e...

    March 18th, 2010 @ 06:41 PM

  8. nickg
    nickg
    • Assigned user changed from Thatcher to nickg

    Try pulling down the latest changes and see if your problem is resolved (or not).

    thanks!

    --nickg

    March 24th, 2010 @ 06:43 PM

  9. nickg
    nickg
    • State changed from new to resolved

    resolving... no one has complained after the fix went in.

    March 30th, 2010 @ 03:03 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.