Struct rocket_cgi::CGIDir

source ·
pub struct CGIDir { /* private fields */ }
Expand description

Custom handler to execute CGIScripts

This handler will execute any script within the directory

Implementations§

Generate a CGI script from the associated path

Examples found in repository?
examples/cgi.rs (line 9)
8
9
10
async fn rocket() -> _ {
    Rocket::build().mount("/a", CGIDir::new("examples/"))
}

Clear file type associations, and disables directly running executables

Add a file type association for executing a file

Only allow executing perl scripts

Only allow executing python scripts

Only allow executing python scripts

Sets the shell interpreter

Default is sh

Adds default Windows Shell Script types:

  • cmd.exe: .cmd, .bat
  • powershell.exe: .ps1
  • cscript.exe: .wsf, .vbs, .js

Whether to allow directly executable files. This may allow scripts with execute permissions and a shebang (#!) to be executed, on some systems.

The CGI spec requires this to be false, which is the default

Whether to pass parameters that contain unencoded =

The CGI spec requires this to be false, which is the default

Whether to allow serving unix hidden files (files starting with a .)

Defaults to false

Whether to allow serving hidden files

Defaults to false, only applies to Windows

Whether to allow serving files with setuid & setgid bits set

Defaults to false, only has an effect on Unix systems. Note this does not prevent a script from executing a setuid bit binary, but rather only protects against Rocket starting a setuid binary

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Called by Rocket when a Request with its associated Data should be handled by this handler. Read more
Converts this type into the (usually inferred) input type.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more