Bugs version 0 1 0

From PlainOldWebserver

Jump to: navigation, search

Contents

bug in serving .sjs files (with solution)

--emchem 03:56, 01 April 2007 (my config WinXP, firefox 2.0.0.3)

Renaming a simple html file in .sjs, will get it served with some extra blank line at the beginning. In fact, it appears that every .sjs file is served with extra blank line (look for example at the source code of index.sjs).

  • It seems so that pow_file() will serv it in the same way: with a blank line (or some bad characters) at the beginnig of requested file, no matter which extension this file has (*.sjs,*.html,*.inc, etc) --kristallex (Fixed in 0.1.1 --DK) 07:12, 2 April 2007 (PDT)

While this behaviour is not harmful for html files, when it comes to xml files serving it's a real bug. You'll then get firefox complaining:

XML Parsing Error: xml declaration not at start of external entity

Test it with this snippet (that uses the pow_header() function) :

  hello.sjs
  
  <?sjs 
  pow_header("Content-Type: text/xml");
  ?><?xml version="1.0" encoding="ISO-8859-1" ?>
  <hi> hello</hi>


You have to correct the file server.js in pow.jar.

Replace the line 170:

  webpage = webpage.replace(/Content-Length: \d+/m,"");


with this one:

  webpage = webpage.replace(/\nContent-Length: \d+/m,"");

pow_DB.drop_database (with solution)

--emchem 05:59, 25 March 2007

Dropping the database doesn't work, since there's a lock on the database (on firefox 2.0.0.3, WinXP) ...

Using this (nullifying the connection) may help :

  <?sjs
  try {
     var pdb = new pow_DB("object_db");
     pdb.conn = null;
     pdb.drop_database("object_db");
  } catch  (e) {
     alert(e.description);
  }
  ?>

that is, freeing the connexion will sometimes help (when you put some alert() functions to trace the code in io.js, this line will appear to be efficient).

(In 0.1.1, nulling the connection happens automatically in drop_database() -- DK)

pow_DB.open (with solution)

--emchem 05:07, 25 March 2007

The function pow_DB.open() throws an error (on firefox 2.0.0.3, WinXP). (Fixed in 0.1.1)

+ The bug appears, in the file io.js, line 867 :

file.append(next_dir);


+ the cause: the use of the double dot notation, in order to get to the parent directory, fails.

+ I replaced the line 867 in io.js with those lines, then it went fine:

 if (next_dir == '..') {
     file = file.parent;
 } else {
     file.append(next_dir);
 }

pow_server.POST

--kristallex 00:33, 19 March 2007 (PDT)

I'm trying to submit a form in two ways:

// browser location: http://internal_IP:6670/some_script.sjs

<form action="http://internal_IP:6670/some_script.sjs" method="POST">

And here i recieve an error under Firefox 2.0. Error like: "Connection aborted by the server".

// browser location: http://external_IP:6670/some_script.sjs

<form action="http://external_IP:6670/some_script.sjs" method="POST">

In IE both works fine.



pow_Database Examples Don't Work in XP

Fix: USE pow_DB.open (with solution) from Above (XP bug fixed in 0.1.1)

Examples work on Mac OS X put not on window's XP. Very very very unexpected. Will have to be investigated. Actually On that machine I did not install Firefox 2 (So I could run both version) in the default directory so it might not be able to find sqlite. But I did the same thing on OS X.

control panel root directory option doesn't work

--Michael Bradley April 16 2007 (my config WinXP, firefox 2.0.0.3) When you set the root directory using the control panel, files are still served from the default location. (Fixed in 0.1.1 --DK)

PNG files not served by POW

PNG files don't seem to be properly served by POW, i.e. the server just gives a text response instead of the requested PNG file. To solve the problem you have to convert the images to gif files!
--It's not a bug. You just need to add a mime type for PNG. It's not there by default. In the POW Options panel enter png in the Extension field, image/png in the Mime-Type field, and check the Binary box. Then click the Add button. (Fixed in 0.1.1 for new installs. Old installs should add this mime type.)

SJS looping fails

--Emchem 04:05, 25 April 2007 (PDT) Looping is not yet implemented, so if you try this snippet you will get an error message:

  <html>
  	<head><title>LOOPING</title></head>
  <body>
  	<table>
  		<tbody>
  			<tr>
  				<td>ID</td>
  				<td>element</td>
  			</tr>
  <?sjs 
     for (var i=0; i<10; i++) {
  ?>
  			<tr>
  				<td>x</td><td>blabla</td>
  			</tr>
  <?sjs
  	}
  ?>
  		</tbody>
  	</table>
  </body>
  </html>

But ... maybe it's better in order to keep the implementation small and simple ;-). (If all text were converted to document.write(text) within the SJS eval engine, the loop would succeed. --DK)

GET variables overwrite POST variables in the pow_server.POST array

--Werehamster 21 March 2008

example here The pow_server.REQUEST and pow_server.GET arrays are correct, but the pow_server.POST array should only contain the POST variables (ver 0.1.7)

Personal tools
Navigation