18:06:57 <HugoDaniel> i keep getting this:
18:07:01 <HugoDaniel> Resource interpreted as script but transferred with MIME type text/html.
18:07:04 <HugoDaniel> as a warning
18:07:11 <HugoDaniel> how do i make sure it does not show up ?
18:07:28 <HugoDaniel> <script src="code.js" type="text/javascript" ></script>
18:07:37 <HugoDaniel> this is what i have in my code
18:07:39 <HugoDaniel> html
18:07:51 <HugoDaniel> and apparently happstack sends it as text/html
18:08:46 <Entroacceptor> set the appropiate content type
18:09:09 <Entroacceptor> how do you server the file?
18:09:38 <HugoDaniel> http://pastie.org/1030243
18:09:50 <HugoDaniel> :P
18:10:10 <Entroacceptor> that's too complex for me...
18:10:19 <HugoDaniel> oh
18:10:21 <HugoDaniel> its easy
18:10:45 <HugoDaniel> look, msum gets a list of handlers
18:10:48 <Entroacceptor> that was a joke, sorry
18:10:51 <HugoDaniel> ah ok
18:11:01 <HugoDaniel> ok
18:11:05 <Entroacceptor> I have   serveFile (asContentType "text/html") s
18:11:07 <HugoDaniel> so i could separate the files by directory
18:11:17 <HugoDaniel> hmm
18:11:31 <Entroacceptor> in my roughly equally complex program ;)
18:11:34 <HugoDaniel> :D
18:11:42 <HugoDaniel> ok
18:11:46 <HugoDaniel> so, let me see
18:11:51 <Entroacceptor> or staticFile s =  serveFile (guessContentTypeM mimeTypes) s
18:11:51 <HugoDaniel> where is serveFile defined ?
18:12:06 <Entroacceptor> happstack.server, IIRC
18:12:09 <HugoDaniel> ok
18:12:16 <HugoDaniel> thanks
18:12:19 <HugoDaniel> :) here i go
18:12:28 <Entroacceptor> did I help you?
18:12:31 <Entroacceptor> \o/
18:12:42 <HugoDaniel> yes
18:21:56 <stepkut> Entroacceptor: why not use fileServe ?
18:23:49 <stepkut> s/Entroacceptor/HugoDaniel/
18:24:03 <stepkut> but looking at the paste it seems you do..
18:24:09 <Entroacceptor> where's the difference??
18:24:29 <stepkut> ACTION is confused about what is going on
18:26:14 <stepkut> in the paste you are using fileServe, in the channel you are talking about serveFile..
18:26:38 <Entroacceptor> stepkut: because that's what I used, maybe?
18:28:36 <Entroacceptor> stepkut: can you lower my confusion by telling me the difference between serverFile and fileServe?
18:28:56 <Entroacceptor> or, better, by renaming then to something sensible ;)
18:30:17 <stepkut> yeah, the naming needs help
18:31:46 <stepkut> fileServe is for serving files from a directory (and it's sub-directories). It automatically guesses the mime-types of the files based on the extensions, and the name of the file in the url path is corresponsed directly to the filename it will look for on the disk (though the prefix of the path my be removed by earlier handlers)
18:32:28 <stepkut> serveFile is for serving a specific file on the disk with a specific mime-type. The filename on disk does not have to be related to the path in the request at all, and the filename extension can be anything
18:33:00 <stepkut> so a request to, /foo/party.mpg, might actually serve content from a file, /srv/802348032.jpg on the disk
18:33:33 <Entroacceptor> mmh, can I tell it to fileServe, but if it's a .html file put it through a filter first?
18:35:16 <stepkut> what do you want the filter to do ?
18:35:48 <stepkut> you want it to actually filter the contents of the .html file ?
18:35:52 <Entroacceptor> apply a template, add a shoutbox and directory listing
18:36:05 <Entroacceptor> yes
18:36:56 <stepcut> in theory you could do that using the filter monad stuff.. but I am not sure that is really the best approach
18:36:59 <HugoDaniel> hmm
18:37:06 <HugoDaniel> it seems that it is not guessing correctly
18:37:10 <HugoDaniel> the mimetype
18:37:45 <stepcut> the fileserve module is set up so that it should be easy to piece together your own specialize file server that has different behaviour
18:38:12 <stepcut> Entroacceptor: among other things, the default fileServe code would try to serve the file using SendFile, which would not really work for your needs
18:39:19 <stepcut> Entroacceptor: hard to say though with out understanding your usage better.. a filter might actually be what you wanted if you want to do the same transformers to any .html content, not just stuff coming from files in a specific directory..
18:39:23 <stepcut> HugoDaniel: :(
18:39:48 <Entroacceptor>  http://pastie.org/private/a5kfw8d9xxfa6w3ga7xkw  is what I've got so far
18:39:55 <stepcut> ("js","application/x-javascript")
18:40:32 <stepcut> HugoDaniel: what happens if you do, curl -v http://yoursite/code.js ? what mime-type does it report ?
18:41:10 <Entroacceptor> basicall I want a cms where the stuff is in files on the disk (instead of a database)
18:41:16 <stepcut> yeah
18:41:41 <stepcut> Entroacceptor: that code looks reasonable, I assume htmlHandler will eventually do more processing ?
18:42:13 <Entroacceptor> yes :)
18:42:36 <stepcut> Entroacceptor: one thing to check is that you handle ../../etc/passwd in a sensible way
18:43:36 <Entroacceptor> yep
18:46:29 <Entroacceptor> do browsers actually send requests with .. in them?
18:49:12 <stepcut> yes
18:49:26 <stepcut> maybe ?
18:49:54 <stepcut> it is certainly possible to construct a request that has .. in it
18:50:19 <stepcut> someone looking to get at ../../etc/password can just telnet to port 80 and type whatever they want ;)
18:51:12 <Entroacceptor> well, I know my code is insecure
18:51:25 <Entroacceptor> I was just thinking about just removing dots from the path
18:51:59 <HugoDaniel> it must be a chrome error
18:52:08 <HugoDaniel> because curl outputs the correct content-type
18:52:54 <stepcut> you have src="code.js", is that really the right path to code.js relative to the .html file that is calling it ?
18:53:01 <stepcut> they are both in the same directory ?
18:54:44 <HugoDaniel> yes
18:54:48 <HugoDaniel> it is calling the code
18:55:07 <HugoDaniel> let me try it in another browser
18:57:13 <HugoDaniel> no errors in opera
18:58:40 <stepcut> maybe text/javascript would be a better mime-type for it ?
18:58:52 <stepcut> though, I am using chrome and fileServe and it seems to work fine
19:01:25 <Entroacceptor> maybe caching issues?
19:38:44 <stepkut> I use chrome on Linux and OS X with out this issue..
21:43:42 <stepkut> so, I want to release a new version of sendfile which has a function like sendFile, but with the type, (IO Iter -> IO a) -> Socket -> Handle -> Integer -> Integer -> IO a
21:44:25 <Entroacceptor> which doesn't help me any :/
21:44:25 <stepkut> sendFile actually calls the low-level sendfile() many times to send the whole file
21:45:21 <stepkut> the first argument of the new function, (IO Iter -> IO a), it used so that you can get inside that send loop and have a chance to do something everytime sendfile returns..
21:45:44 <stepkut> for example, you could update the timeout timer everytime you successfully send a chunk
21:45:52 <stepkut> the problem is.. I need a name for this new  function :)
21:46:34 <stepkut> sendFileDoSomethingInBetweenEachCallToTheSystemSendfile seems a bit verbose :-/
21:47:01 <Entroacceptor> sendFileWithProgressHook
21:47:43 <Entroacceptor> rIOIterIOaSocketHandleIntegerIntegerIOaSendFileDoSomethingInBetweenEachCallToTheSystemSendfile
21:48:00 <Entroacceptor> hungarian notation ftw!
21:51:17 <stepkut> we have sendFile and sendFile', I could add sendFile'' :)
21:52:21 <Entroacceptor> you do know that note about Haskell programmers and operators?
21:52:26 <Entroacceptor> it's a bit like this...
21:52:27 <Entroacceptor> NO!
21:52:51 <Entroacceptor> progressingSendFile
21:54:22 <stepcut> progress is  close..
21:54:42 <Entroacceptor> sendTheFileAndStopBetweenSteps
21:55:17 <stepcut> it's weird because you can use the callback to monitor the progress.. but you also have responsibilities.. for example, if the Fd blocked, you have to provide the code that waits until the Fd is ready again. And you have to call the 'continuation' that starts the next step..
21:56:05 <stepcut> I have been calling the function you pass in the 'stepper' function.. but that is just something I made it.. it doesn't mean anything
21:56:06 <Entroacceptor> sendFileWhichLovesYouAndThusCallsBack
21:56:20 <stepcut> sendFilePro
21:56:32 <Entroacceptor> sendFilePro20Beta?
21:56:36 <Entroacceptor> sendFilr
21:57:23 <stepcut> sendFile, sendFile', and sendFile_
21:57:48 <Entroacceptor> sendFile:(
21:58:12 <Entroacceptor> (because it sounds complicated)
22:05:09 <Entroacceptor> sendFileEx
22:35:53 <Entroacceptor> and, what did you chose?
22:40:00 <stepkut> nothing, I took a nap instead
22:40:14 <Entroacceptor> :D
23:53:02 <stepcut> sendFileIterWith ?
23:54:13 <Entroacceptor> sendfileWithExtras
23:54:47 <stepkut> we already that.. sendFile'
23:54:56 <stepkut> which takes an offset and length
23:55:09 <stepkut> I need an IterWith version of that function too
23:55:16 <stepkut> sendFileWithExtrasIterWith ;)