Opened 13 years ago
Closed 12 years ago
#5732 closed defect (fixed)
baseUrl not computed when url has a parameter
Reported by: | guest | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | Core | Version: | 1.0 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
When using a server framework it is often the case that url rewriting becomes an issue. For example, if you don't know your application context and are using JSP, you might want to wrap your dojo call in a c:url:
<script type='text/javascript' src='<c:url value="/javascript/dojo/dojo.js"/>'></script>
However, if cookies are turned off, a session identified might be appended to the url:
<script type='text/javascript' src='/myapp/javascript/dojo/dojo.js;jsessionid=23482357984578578542875'></script>
This added parameter breaks the regex in hostenv_browser.js so that baseUrl is not computed:
var rePkg = /dojo(.xd)?.js([?.]|$)/i;
The regex should probably be changed to (notice the extra semi-colon):
var rePkg = /dojo(.xd)?.js([;?.]|$)/i;
to handle this case.
Change History (9)
comment:1 Changed 13 years ago by
Milestone: | 1.0.3 |
---|---|
Owner: | changed from anonymous to James Burke |
comment:2 Changed 13 years ago by
It is valid syntax: it is a path parameter rather than a query parameter. See the last paragraph of 3.3: http://www.rfc.net/rfc3986.html#p22
comment:4 Changed 13 years ago by
Cc: | [email protected]… added |
---|---|
Milestone: | → 1.1 |
I'll see about getting this in for 1.1. Note that you can always force the baseUrl via djConfig.baseUrl, so that is a workaround.
comment:5 Changed 13 years ago by
Setting djConfig.baseUrl, while an acceptable workaround, has two issues which prevent it from being a "good" fix:
- You can hard-code it, but now your application is no longer context-agnostic
- You can run a regular expression against window.location.href, but it would be almost exactly the same code as in hostenv_browser.js (except with the extra semi-colon).
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 Changed 12 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The fixed RegularExpression? from the changeset:122272 should also be used in the dojo.js because there is also code which tries to figure out the baseUrl.
comment:8 Changed 12 years ago by
Milestone: | 1.1 → 1.3 |
---|
since these tickets were reopened, marking milestone as 1.3 (the next uncompleted milestone) so we don't overlook them
comment:9 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
is this a valid url syntax?