#1 ✓resolved
Ash Berlin

Update Zest request object

Reported by Ash Berlin | October 25th, 2009 @ 04:21 PM

Update the request object that Zest produces to conform to the latest 0.3 proposal. It should look like this (without the juice specific bits):

({
    jsgi: {
        version: [0, 3/*, 0*/], // no level in 0.3 L0 -- L0 doesn't care about levels
        errors: {},

        // other required jsgi keys
        multithread: false,
        multiprocess: true,
        runonce: false, // runOnce?

        // optional jsgi keys...I think -- nobody's spoken up as to why they should be required
        async: undefined // zest doesn't support promises yet, right?
        cgi: undefined, // right?
    },
    /*requestM*/method: "GET",
    scriptName: "",
    pathInfo: "/",
    queryString: "",
    scheme: "http",
    /*body*/input: {}, // tom thinks input makes more sense for stream -- a sensible "body" property could be part of Level 1
    /*serverName*/host: "tethys.config", // host -- why? F@#$ CGI, that's why!
    /*serverP*/port: /*"*/3000/*"*/, // parsed as int...why not?
    headers: {
        host: "tethys.config:3000",
        'user-agent': "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/532.3+ (KHTML, like Gecko) Version/4.0.3 Safari/531.9",
        accept: "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
        'accept-language': "en-us",
        'accept-encoding': "gzip, deflate",
        connection: "keep-alive"
    },
    env: {juice: { // custom keys go in the env top level key
        params: {
            get: {},
            post: {}
        },
        docRoot: "/Users/ash/code/js/juiceframework/foo/"
    }},

    // more required keys
    version: [1, 1], // parsed HTTP level...why parsed? eh, why not :)

    // more optional keys...may as well explicitly override CGI
    authType: null, // authenticationType?
    remoteAddr: "0.0.0.0", // remoteAddress?
    remoteHost: null /* CGI::REMOTE_HOST */,
    remoteIdent: null /* CGI::REMOTE_IDENT */, // remoteIdentity?
    remoteUser: null /* CGI::REMOTE_USER */,
    serverSoftware: null /* CGI::SERVER_SOFTWARE */ // is this ever useful?
    // exclude PATH_TRANSLATED
})

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The simple HTTP development server that comes bunleded with Juice

Shared Ticket Bins

People watching this ticket

Referenced by

Pages