Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 1e4be4f6cca2c9a2bfc532dbed99ff6a > files > 52

aikido-1.40-6mdv2010.0.i586.rpm

/*
 * cgi.aikido
 *
 * Aikido Language System,
 * export version: 1.00
 * Copyright (c) 2002 Sun Microsystems, Inc.
 *
 * Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License Version 1.0 (the "License"). You
 * may not use this file except in compliance with the License. A copy of the License is available
 * at http://www.opensource.org/licenses/sunpublic.php
 * 
 * The Original Code is Aikido. 
 * The Initial Developer of the Original Code is David Allison on behalf of Sun Microsystems, Inc. 
 * Copyright (C) Sun Microsystems, Inc. 2000-2003. All Rights Reserved.
 * 
 * 
 * Contributor(s): dallison
 *
 * Version:  1.4
 * Created by dallison on 4/19/2002
 * Last modified by dallison on 03/07/29
 */


import url
import httpfilter
import htmlfilter
import htmlpage

class CGIScript (contentType = "text/html") {
public:
    const server_software = System.getenv ("SERVER_SOFTWARE")
    const server_name = System.getenv ("SERVER_NAME")
    const gateway_interface = System.getenv ("GATEWAY_INTERFACE")
    const server_protocol = System.getenv("SERVER_PROTOCOL")
    const server_port = System.getenv("SERVER_PORT")
    const request_method = System.getenv("REQUEST_METHOD")
    const http_accept = System.getenv("HTTP_ACCEPT")
    const path_info = System.getenv("PATH_INFO")
    const path_translated = System.getenv("PATH_TRANSLATED")
    const script_name = System.getenv("SCRIPT_NAME")
    const query_string = System.getenv("QUERY_STRING")
    const remote_host = System.getenv("REMOTE_HOST")
    const remote_addr = System.getenv("REMOTE_ADDR")
    const remote_user = System.getenv("REMOTE_USER")
    const auth_type = System.getenv("AUTH_TYPE")
    const content_type = System.getenv("CONTENT_TYPE")
    const content_length = System.getenv("CONTENT_LENGTH")

    var url = new URL (System.getwd(), query_string, "")

    // create 
    var mimestream = new MimeFilter (stdin, stdout)
    mimestream.putHeader ("Content-Type", contentType)
    System.redirectStream (output, mimestream)

}