D2 & Web-Framework

Nick Sabalausky a at a.a
Thu Jul 14 21:33:52 PDT 2011


"Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
news:ivo1ga$1ete$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> (Not sure why IIS changes the redirect's "/" to "localstart.asp",
>> probably just IIS trying to be "smart", but I usually only use IIS > 
>> locally, so
> I don't really care right now).
>
> It's possible I messed up... the line of code is specifically:
>
>        cgi.setResponseLocation(cgi.requestUri ~ "/");
>
> which is supposed add the slash. But maybe my requestUri member
> is wrong on IIS, so it saw just the slash, and that redirected to the
> other thing.
>
>
> Hmmmm, a quick web search tells me that IIS doesn't set REQUEST_URI
> the same way as Apache, so this is probably a bug in cgi.d. I
> thought that was a standard, but it looks like it might be an
> Apache extension.
>
> Huh, I've gotta think about this.
>

More detailed information in case it's helpful:

The URL I typed into the browser was:

http://localhost/darticles/articles-debug.exe

According to HttpFox (FF plugin), the headers received were:

HTTP/1.1 302 Object moved
Server: Microsoft-IIS/5.1
Date: Fri, 15 Jul 2011 04:18:56 GMT
X-Powered-By: ASP.NET
Connection: close
Location: localstart.asp
Content-Length: 121
Content-Type: text/html
Cache-Control: private

Note, FWIW, that's a relative path in the "Location". Ie, it's 
"localstart.asp", not "/localstart.asp", so the browser then goes to 
http://localhost/darticles/localstart.asp

If I insetad go to http://localhost/darticles/articles-debug.exe/ then it 
all works right.

Although I guess that probably doesn't help tell you what the CGI app 
received from IIS...


>> Oh, one other thing I noticed: With DMD 2.054 banning implicit
>> switch/case fallthrough, it pointed out an implicit fallthrough
>> in dom.d at line 2641
>
> That's interesting... I updated my dmd but didn't see this....
>
> but yes that's definitely a bug, also in my copy of the code.
> Add a break to it.
>
> You might want to grab a new copy of dom.d. I think your copy is
> pretty old in general, since that line number is a few hundred
> lines different than my copy.
>
> http://arsdnet.net/dcode/dom.d
>
> The newer one has stuff like requireSelector and requireElementById
> that we discussed a while ago, among other things.
>

My copy does have requireSelector and requireElementById, but yea, it looks 
like that latest one does have a lot of new stuff.


> (that dcode folder is updated on random whims. I do changes for
> myself in another location then copy it over usually when I talk
> about it on the newsgroup.)
>

Sooo...I don't suppose you've given thought to using Hg/BitBucket or 
Git/GitHub? ;)

It'd make a lot of things much easier for both you and others using your 
code.  And it would better facilitate people submitting patches to you. They 
are an extra tool to learn and use, but they're well worth it.


>
> Anywho.
>
> That's embarrassing... every time bearophile mentions fallthrough,
> I defend it - it's sometimes useful and besides, those bugs
> *never* happen to *me*.
>
> Blargh.
>

 :)





More information about the Digitalmars-d mailing list