 |
|
 |
|
Next: Web Server Access
|
| Author |
Message |
External

Since: Jun 29, 2004 Posts: 3
|
(Msg. 1) Posted: Wed Jun 30, 2004 12:28 am
Post subject: Javascript document write not working after iis5 to iis6 move Archived from groups: microsoft>public>inetserver>iis (more info?)
|
|
|
We have an application that has been running on IIS4 and IIS5 for
quite some time, without problem We're now migrating to IIS6
(windows/2003), and have run into a what might be a Javascipt
problem/question, or might be an IIS issue...
The snippet of code in question is:
<script language="JavaScript"><!--
document.write("<script src='/fp/"+includename+"'></script>");
// -->></script>
The included filename is a variable, and does not have a .js
extension. It points to a filename among several thousand files. The
included files ARE javascript files, and contain nothing but
javascript.
This code works fine in IIS4 and IIS5. But when moving to IIS6, the
<script> statement is ignored (because the includename does not end
with .js). If (as a test), I do add a .js on the end of the
includename in the script statement (and create a matching include.js
file), then things work fine.
Our problem is we cannot rename the thousands of files to .js
extensions (they are produced and used by other processes, and the
filename changes would mean more changes in these systems).
I've tried specifying the language, and the type, in the script
statement, but it does not make a difference:
<script language="JavaScript"><!--
document.write("<script language='JavaScript' type='text/javascript'
src='/fp/"+includename+"'></script>");
// -->></script>
It still ignores the <script> statement.
I'm not sure if this is an IIS6 issue, or a Javascript issue. Is
there some way to tell IIS6 to accept the included filename in the SRC
statement as Javascript (as worked in IIS4/IIS5), knowing that the
files do not end in .js?
Thanks for your thoughts. >> Stay informed about: Javascript document write not working after iis5 to iis6 m.. |
|
| Back to top |
|
 |  |
External

Since: Aug 25, 2003 Posts: 2419
|
(Msg. 2) Posted: Wed Jun 30, 2004 5:56 am
Post subject: Re: Javascript document write not working after iis5 to iis6 move [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Here is what's going on.
When the browser processes your <script> injection, it is going to cause it
to make an additional HTTP request to the server for /fp/something
IIS processes this request like any other (the browser is expecting a
file-download so that it can interpret the script file on the client).
Problem here is that your web pages require resources with "no extensions"
to be downloadable, and that is not enabled by default. IIS6 does not allow
unknown MIME Type resources to be served, and "extension-less" resources
belong in this unknown category. So to fix this, you need to add a MIME
Type for the "extension-less" extension.
And actually, there is a bug (fixed in WS03 SP1) in that you currently
cannot define a MIME Type for an extension-less resource. Thus, the only
solution (very hacky) is to create a MIME Type for .* (i.e. all extensions)
to make it downloadable.
If these extensionless resources are only in the /fp vdir, then I suggest
setting the MIME Type of .* for only the /fp vdir (so you don't screw up
other applications with a global setting). This should allow those
resources to be downloaded, and you can move forward with your application
migration.
The security feature of only allowing resources with defined MIME Types to
be downloadable is one of many security changes made in IIS6. This feature
alone would prevent people from somehow tricking IIS6 into serving .ASP
files without processing them (to steal DB connection username/password, for
example). ASP files do not have a defined MIME Type, thus IIS6 won't allow
files of those extensions to be downloadable.
I highly suggest you read IIS Documentation to get a feel for the dramatic
changes between IIS5 and IIS6, many of them introduced for security reasons.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Kevin Potter" <krpotter DeleteThis @co.douglas.or.us> wrote in message
news:64f69747.0406292028.3599ad37@posting.google.com...
We have an application that has been running on IIS4 and IIS5 for
quite some time, without problem We're now migrating to IIS6
(windows/2003), and have run into a what might be a Javascipt
problem/question, or might be an IIS issue...
The snippet of code in question is:
<script language="JavaScript"><!--
document.write("<script src='/fp/"+includename+"'></script>");
// -->></script>
The included filename is a variable, and does not have a .js
extension. It points to a filename among several thousand files. The
included files ARE javascript files, and contain nothing but
javascript.
This code works fine in IIS4 and IIS5. But when moving to IIS6, the
<script> statement is ignored (because the includename does not end
with .js). If (as a test), I do add a .js on the end of the
includename in the script statement (and create a matching include.js
file), then things work fine.
Our problem is we cannot rename the thousands of files to .js
extensions (they are produced and used by other processes, and the
filename changes would mean more changes in these systems).
I've tried specifying the language, and the type, in the script
statement, but it does not make a difference:
<script language="JavaScript"><!--
document.write("<script language='JavaScript' type='text/javascript'
src='/fp/"+includename+"'></script>");
// -->></script>
It still ignores the <script> statement.
I'm not sure if this is an IIS6 issue, or a Javascript issue. Is
there some way to tell IIS6 to accept the included filename in the SRC
statement as Javascript (as worked in IIS4/IIS5), knowing that the
files do not end in .js?
Thanks for your thoughts. >> Stay informed about: Javascript document write not working after iis5 to iis6 m.. |
|
| Back to top |
|
 |  |
External

Since: Aug 23, 2003 Posts: 2972
|
(Msg. 3) Posted: Wed Jun 30, 2004 10:04 am
Post subject: Re: Javascript document write not working after iis5 to iis6 move [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hello,
My understanding of your message is that your file(s) does not end with
anything. IIS 6.0 will not serve this unknown "extension", and the
javascript file is therefore not used by the client.
Add the MIME type, and it will work.
--
Regards,
Kristofer Gafvert - IIS MVP
<a style='text-decoration: underline;' href="http://www.ilopia.com" target="_blank">http://www.ilopia.com</a> - When you need help!
"Kevin Potter" <krpotter.DeleteThis@co.douglas.or.us> wrote in message
news:64f69747.0406292028.3599ad37@posting.google.com...
> We have an application that has been running on IIS4 and IIS5 for
> quite some time, without problem We're now migrating to IIS6
> (windows/2003), and have run into a what might be a Javascipt
> problem/question, or might be an IIS issue...
>
> The snippet of code in question is:
>
> <script language="JavaScript"><!--
> document.write("<script src='/fp/"+includename+"'></script>");
> // -->></script>
>
> The included filename is a variable, and does not have a .js
> extension. It points to a filename among several thousand files. The
> included files ARE javascript files, and contain nothing but
> javascript.
>
> This code works fine in IIS4 and IIS5. But when moving to IIS6, the
> <script> statement is ignored (because the includename does not end
> with .js). If (as a test), I do add a .js on the end of the
> includename in the script statement (and create a matching include.js
> file), then things work fine.
>
> Our problem is we cannot rename the thousands of files to .js
> extensions (they are produced and used by other processes, and the
> filename changes would mean more changes in these systems).
>
> I've tried specifying the language, and the type, in the script
> statement, but it does not make a difference:
>
> <script language="JavaScript"><!--
> document.write("<script language='JavaScript' type='text/javascript'
> src='/fp/"+includename+"'></script>");
> // -->></script>
>
> It still ignores the <script> statement.
>
> I'm not sure if this is an IIS6 issue, or a Javascript issue. Is
> there some way to tell IIS6 to accept the included filename in the SRC
> statement as Javascript (as worked in IIS4/IIS5), knowing that the
> files do not end in .js?
>
> Thanks for your thoughts.<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Javascript document write not working after iis5 to iis6 m.. |
|
| Back to top |
|
 |  |
External

Since: Aug 23, 2003 Posts: 2901
|
(Msg. 4) Posted: Wed Jun 30, 2004 5:33 pm
Post subject: Re: Javascript document write not working after iis5 to iis6 move [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Hi,
http://support.microsoft.com/?id=326965
IIS 6.0 Does Not Serve Unknown MIME Types
Cheers
Ken
"Kevin Potter" <krpotter DeleteThis @co.douglas.or.us> wrote in message
news:64f69747.0406292028.3599ad37@posting.google.com...
: We have an application that has been running on IIS4 and IIS5 for
: quite some time, without problem We're now migrating to IIS6
: (windows/2003), and have run into a what might be a Javascipt
: problem/question, or might be an IIS issue...
:
: The snippet of code in question is:
:
: <script language="JavaScript"><!--
: document.write("<script src='/fp/"+includename+"'></script>");
: // -->></script>
:
: The included filename is a variable, and does not have a .js
: extension. It points to a filename among several thousand files. The
: included files ARE javascript files, and contain nothing but
: javascript.
:
: This code works fine in IIS4 and IIS5. But when moving to IIS6, the
: <script> statement is ignored (because the includename does not end
: with .js). If (as a test), I do add a .js on the end of the
: includename in the script statement (and create a matching include.js
: file), then things work fine.
:
: Our problem is we cannot rename the thousands of files to .js
: extensions (they are produced and used by other processes, and the
: filename changes would mean more changes in these systems).
:
: I've tried specifying the language, and the type, in the script
: statement, but it does not make a difference:
:
: <script language="JavaScript"><!--
: document.write("<script language='JavaScript' type='text/javascript'
: src='/fp/"+includename+"'></script>");
: // -->></script>
:
: It still ignores the <script> statement.
:
: I'm not sure if this is an IIS6 issue, or a Javascript issue. Is
: there some way to tell IIS6 to accept the included filename in the SRC
: statement as Javascript (as worked in IIS4/IIS5), knowing that the
: files do not end in .js?
:
: Thanks for your thoughts. >> Stay informed about: Javascript document write not working after iis5 to iis6 m.. |
|
| Back to top |
|
 |  |
External

Since: Jun 29, 2004 Posts: 3
|
(Msg. 5) Posted: Wed Jun 30, 2004 10:34 pm
Post subject: Re: Javascript document write not working after iis5 to iis6 move [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"David Wang [Msft]" <someone DeleteThis @online.microsoft.com> wrote in message news:<ea5ZXnoXEHA.1356 DeleteThis @TK2MSFTNGP09.phx.gbl>...
> Here is what's going on.
>
> When the browser processes your <script> injection, it is going to cause it
> to make an additional HTTP request to the server for /fp/something
>
> IIS processes this request like any other (the browser is expecting a
> file-download so that it can interpret the script file on the client).
> Problem here is that your web pages require resources with "no extensions"
> to be downloadable, and that is not enabled by default. IIS6 does not allow
> unknown MIME Type resources to be served, and "extension-less" resources
> belong in this unknown category. So to fix this, you need to add a MIME
> Type for the "extension-less" extension.
>
> And actually, there is a bug (fixed in WS03 SP1) in that you currently
> cannot define a MIME Type for an extension-less resource. Thus, the only
> solution (very hacky) is to create a MIME Type for .* (i.e. all extensions)
> to make it downloadable.
>
> If these extensionless resources are only in the /fp vdir, then I suggest
> setting the MIME Type of .* for only the /fp vdir (so you don't screw up
> other applications with a global setting). This should allow those
> resources to be downloaded, and you can move forward with your application
> migration.
>
> The security feature of only allowing resources with defined MIME Types to
> be downloadable is one of many security changes made in IIS6. This feature
> alone would prevent people from somehow tricking IIS6 into serving .ASP
> files without processing them (to steal DB connection username/password, for
> example). ASP files do not have a defined MIME Type, thus IIS6 won't allow
> files of those extensions to be downloadable.
>
> I highly suggest you read IIS Documentation to get a feel for the dramatic
> changes between IIS5 and IIS6, many of them introduced for security reasons.
>
> --
> //David
> IIS
> This posting is provided "AS IS" with no warranties, and confers no rights.
> //
> "
David, thanks for the info on the wildcard MIME type... setting that
just for the directory in question did the trick!<!-- ~MESSAGE_AFTER~ --> >> Stay informed about: Javascript document write not working after iis5 to iis6 m.. |
|
| Back to top |
|
 |  |
| Related Topics: | trying to write script to add application mappings in IIS5.. - Hi, I am trying to write a batch file that will allow the user to run it and specify a website on the IIS 5 / 5.1 server and have it do the following: - Map .asp to the ASP.NET DLL instead of the ASP DLL - Map several others e.g. .CSS, .JPG, .GIF, .ZIP...
external javascript reference not working on SSL - I'm not sure if this is the best place to ask this but I'm going to try. I've been using an external javascript reference to pull in a menu on a page within a secure area for over a year now but all of a sudden a week ao so ago on that Thursday when..
external javascript reference not working all of a sudden .. - I'm not sure if this is the best place to ask this but I'm going to try. I've been using an external javascript reference to pull in a menu on a page within a secure area for over a year now but all of a sudden a week ao so ago on that Thursday when..
Document on IIS6.0 with NLB - Hi, Is there any documentation talking about the procedure of setting up an web server using IIS6.0 with network load balancing? Thx, Alan T
IIS6 Serving Encoded JavaScript File - It appears that by default IIS6 will not serve encoded javascript files (.jse), thus the following line does not download the required file: <html> ... <script language="jscript.encode" src="myscript.jse&q... |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|