GithubHelp home page GithubHelp logo

omniti-labs / mungo Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 954 KB

The anti-framework for perl on the web.

License: BSD 3-Clause "New" or "Revised" License

Perl 98.13% Perl 6 0.12% ASP 0.75% HTML 0.95% SourcePawn 0.03% PHP 0.01% Assembly 0.01%
apache-httpd performance perl scalability

mungo's People

Contributors

2shortplanks avatar bdunavant avatar clintoncwolfe avatar cschammel avatar dhubbard-omniti avatar lfayer avatar neophenix avatar postwait avatar xzilla avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mungo's Issues

Check additional headers for ServerVariables('REMOTE_IP')

While HTTP_X_FORWARDED_FOR and REMOTE_ADDR probably have the best chance of capturing a client's IP, there are some other's that could be checked as well with lesser precedence, depending on how robust you want it to be. HTTP_VIA, HTTP_CLIENT_IP, etc

Module source dump on error does not appear to work

Per trac3, errors at runtime or compile time within a module should dump the module source code to the browser. Instead, we only see the error message.

Specimen tests, from 13-errors.t series:

Runtime die within a custom loaded module

Attempt to use module that won't compile

Make referrer avaialble

Reported by lfayer on 1 Jan 1970 00:20 UTC
Add referrer option to $Request->ServerVariables

Need $Server->sub URLDecode.

Reported by jesus on 1 Jan 1970 00:19 UTC

sub URLDecode {
  my $self = shift;
  my $s = shift;
  $s =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/eg;
  return $s;
}

Mungo::Response has high overhead

Reported by jesus on 1 Jan 1970 00:20 UTC
The Mungo::Response is a tied hash and there is a lot of lookups of keys within the module itself $self->{key}. This causes large overhead and the ugly peeking into the tied internals should be done for performance reasons within the module proper.

Large file upload broken

Reported by jesus on 1 Jan 1970 00:19 UTC
Large file uploads result in zero bytes available on the file handle.

Make error reporting more robust.

Reported by jesus on 1 Jan 1970 00:19 UTC
Error reporting should show compile and runtime errors the same and it should display the contents of perl modules if they are the culprit (not just ASP pages).

Allow pages to override the main Mungo::Response error display

Reported by jesus on 1 Jan 1970 00:19 UTC
If we die, Mungo::Response formats us an error (optionally with a stack trace and code highlighting). This is great for debugging, but in production apps we want to pretty print "something else."

Allow us to replace the way errors are rendered.

Mungo should respect existing MIME types

Reported by jschulz on 1 Jan 1970 00:19 UTC
Mungo currently defaults to serving all files as text/html. It should try to use any existing Apache (mod_mime) settings before finally falling back to text/html.

'''To reproduce''', add the following to httpd.conf

<Files ~ (\.(asp|css|js|html|xml))>    
   SetHandler  perl-script
   PerlSetVar StatINC 1
   PerlHandler Mungo
</Files>

Now, all files with those extensions will be served as text/html, even JavaScript and CSS.
If a doctype of:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

is added, the page will "break" because the CSS and JavaScript will not be recognized as the appropriate type of file.

The page will lack any CSS styling and any JavaScript will not function.

'''Remedy:'''
You can add the following to httpd.conf

<Files ~ (\.(css))> 
   PerlSetVar MungoContentType 'text/css'
</Files>

<Files ~ (\.(js))> 
   PerlSetVar MungoContentType 'text/javascript'
</Files>

<Files ~ (\.(xml))> 
   PerlSetVar MungoContentType 'text/xml'
</Files>

but Mungo should respect (or at least try to obtain) those types already set in conf/mime.types.

If reading from conf/mime.types is too difficult/expensive, a single place (mungo.mime ?) to record all those associations would be appreciated.

PreferredLanguage feature for Response

Add a property to Response, PreferredLanguage?.

When calling the i18nHandler, if PreferredLanguage? is set, send it as the second arg. If not set, parse the Accept-Language header and sent its values as an array ref.

Tests for Mungo::Quiet

No tests cover Mungo::Quiet. Especially need tests to check the Apache error log (Apache::Test provides facilities for this).

Mungo start tag is parsed out even in quoted strings

This will cause an error: <%

my $embedded = '<%= "some text" %>'; # mis-parse on this line

%>

Mungo does not check to see if a start tag is quoted.

Workaround currently include slash-escaping or breaking the string into pieces.

Test 07-include/include-string currently uses the workaround (rev61) Test 04-parser/quoted-start-tag-bug17 currently demonstrates the problem (rev61)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.