WB Internal Web Server

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

WB Internal Web Server

Post by NearZero »

Unfortunately I need to refer to: http://forums.blumentals.net/viewtopic.php?f=4&t=3389 a locked thread, I decided to have a closer look at what was going on....

Now, in regard to the above issue, the Mozilla ActiveX Control is NOT the problem, the problem is the WB Internal Web Server.
Comments below as per the above thread examples.

The WB Internal Web Server does not send the correct content-type header for CSS style sheets, it sends text/html when it should send text/css.
As a result of this Firefox being more rigid rejects the stylesheet.

Look at the bill anton example in the above thread page 2, works for HTML but as PHP it fails, well actually it will fail as HTML also, but first some quick info...
When you are using the internal web server and preview a HTML file, the file is opened directly by the browser. WB uses file:// NOT http://.
thats fine, no problem. In this case FF will work, as it is opening the file locally.

However with a PHP file, preview WB will use the internal web server, and you would see something like http://localhost:89/~C/test/index.php. Now
the example will fail in Firefox, the content-type header is wrong.

So leave WB running, now start Firefox, point it to HTML example (above thread), you'll need something like:

http://localhost:89/~C/TEST/index.htm (~C is the drive, the rest is the local path/file).

Now you ARE using the WB Internal Web Server and NO Mozilla ActiveX control, notice the stylesheet failed, check Firefox error console!
As mentioned, here we see simple html with etxernal style sheet failing (albeit Firefox only).

Hope this makes sense, I could provide more detail, but since the above thread was available I took a shortcut.

If you download WGET for windows, you can simply use: wget -S http://localhost:89/~C/TEST/SOMEFILE.CSS, here you can see the header information that the browser would, the content-type is incorrectly shown as text/html it should show text/css.

Cheers all :)
davenz

Re: WB Internal Web Server

Post by davenz »

As far as I am aware the built-in web server has nothing to do with 'normal' previews, as rendered in the Preview window/tab. The Preview tab uses either Internet Explorer or the now-out-of-date Mozilla control to render local previewed pages within the editor. The built-in web server is used only for those who want to test their server-side scripting or acvtive server pages; it has nothing to do with the normal preview pane.

I probably haven't understood what you are actually meaning.

Dave.
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WB Internal Web Server

Post by NearZero »

Hi davenz,

Yes, seems I have confused you.

Let's just look at one thing, WB built-in web server.

Here are the results of requesting a CSS stylesheet from IIS, APACHE and WB Built-in web server.
I use WGET to see the header that is returned by the Web Server.


==> APACHE
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Via: 1.1 0
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 1741
Date: Mon, 05 Jan 2009 22:51:12 GMT
Content-Type: text/css
ETag: "e70121-6cd-42ca7660"
Server: Apache
Last-Modified: Tue, 05 Jul 2005 12:00:32 GMT
Accept-Ranges: bytes
Keep-Alive: timeout=15, max=100
Length: 1741 (1.7K) [text/css]


===> IIS
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
X-Powered-By: ASP.NET
Connection: keep-alive
Date: Mon, 05 Jan 2009 22:52:41 GMT
Content-Type: text/css
Accept-Ranges: bytes
Last-Modified: Fri, 02 Jan 2009 01:27:10 GMT
ETag: "07d683b796cc91:b9d"
Content-Length: 309
Length: 309 [text/css]


==> WeBuilder
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html
Content-Length: 309
Server: Indy/9.0.18
Length: 309 [text/html]


Notice the MimeType... Content-Type: text/css in both apache and IIS, but WeBuilder returns text/html.

This means that FireFox will NEVER be able to apply an external stylesheet to any document that is previewed through the WB built-in web server.
So if you have a PHP file that consists of HTML and uses an external stylesheet your not going to see it render correctly.

If all you have is the built-in web server (your mappings are disabled), then even your external firefox preview will fail with the above mentioned type of PHP file.
Sure your PHP will work, your just not going to see your styles applied.

Firefox will not download a document it believes is CSS when the web server say's it's HTML.

The Built-in web server needs to report the correct content type for the document being requested.

Hope that helps, on the other hand I might have made it worse :).
davenz

Re: WB Internal Web Server

Post by davenz »

Nope, got you this time. Yes, it does appear something is screwey there.

Thanks for the clarification.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: WB Internal Web Server

Post by syrupcore »

nice work nearzero. again, thanks a lot for taking the time to write it up. If every bug report were this well explained, they'd prolly be on version 11 by now. ;)
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: WB Internal Web Server

Post by Karlis »

I'll try to fix this. As I understand the CSS needs to be passed with text/css in header and not text/html
Karlis Blumentals
Blumentals Software
www.blumentals.net
NearZero
Posts: 26
Joined: Mon Oct 08, 2007 1:52 pm

Re: WB Internal Web Server

Post by NearZero »

I'll try to fix this. As I understand the CSS needs to be passed with text/css in header and not text/html
Thats it, thanks Karlis :)
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: WB Internal Web Server

Post by Karlis »

I just checked it, seems to be correct. Could it be that this happens on some systems only? The part of the algorithm responsible for MIME is set to read MIME types from Windows system registry.
Karlis Blumentals
Blumentals Software
www.blumentals.net
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: WB Internal Web Server

Post by Karlis »

My bad, found and fixed the bug. Will publish with the next regular update.
Karlis Blumentals
Blumentals Software
www.blumentals.net
Post Reply