Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH]Web tracebacks should be disable-able #7452

Closed
twisted-trac opened this issue Jul 28, 2003 · 12 comments
Closed

[PATCH]Web tracebacks should be disable-able #7452

twisted-trac opened this issue Jul 28, 2003 · 12 comments

Comments

@twisted-trac
Copy link

itamarst's avatar @itamarst reported
Trac ID trac#135
Type defect
Created 2003-07-28 06:09:53Z

Attachments:

  • utils.py.patch (530 bytes) - added by rich on 2003-08-07 05:23:12Z -
  • view.py.patch (2266 bytes) - added by rich on 2003-08-07 05:23:59Z -
  • server.py.patch (481 bytes) - added by rich on 2003-08-07 05:27:31Z -
  • web.py (972 bytes) - added by rich on 2003-08-07 05:41:29Z -
  • server.py.2.patch (1498 bytes) - added by rich on 2003-08-07 06:06:30Z -
Searchable metadata
trac-id__135 135
type__defect defect
reporter__itamarst itamarst
priority__high high
milestone__ 
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__web web
keywords__ 
time__1059372593000000 1059372593000000
changetime__1140919209000000 1140919209000000
version__ 
owner__dp dp

@twisted-trac
Copy link
Author

itamarst's avatar @itamarst commented
#!html
<pre>
Showing the source and locals etc. is a security risk (e.g.
it will display the RPY where you store your database
usernamenpasword config, etc..)

Thus, it should be off by default. I recommend a ".debug =
False" attribute on Site that can be set to True.

</pre>

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented
#!html
<pre>
Nope, this should be turned on by default, since when you
are using defaults you are typically developing.  System
administrators can make this a site-local default by adding
to sitecustomize.py or somesuch.

</pre>

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented
#!html
<pre>
We have agreed that users must be able to disable web
tracebacks, regardless of what the default behavior should
be.  We can argue about that later.  Who wants to volunteer
to fix this? :)

</pre>

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented
#!html
<pre>
looks like you are the "volunteer", lv

</pre>

@twisted-trac
Copy link
Author

LordVan's avatar LordVan commented
#!html
<pre>
/me ? ;)

</pre>

@twisted-trac
Copy link
Author

syver's avatar syver commented
#!html
<pre>
I need a quick fix for this behaviour, where in the source 
should one go to put the if on the debug flag.

</pre>

@twisted-trac
Copy link
Author

rich's avatar rich commented
#!html
<pre>
I've attached three patches that address this. First is a patch to 
server.Site to add a displayTraceback attribute. This defaults to True.

Second is the patch to view.View. This checks the site's displayTraceback 
attribute in renderFailure. If it's false it writes self.genericFailure which 
can be overriden in a subclass.

The last patch is to utils.renderFailure to make it continue to log the 
tracebacks but skip the request.write based on the flag in site.

</pre>

@twisted-trac
Copy link
Author

rich's avatar rich commented
#!html
<pre>
For the sake of completeness I've added a fourth patch. This adds an 
option to twisted.tap.web to toggle displaying tracebacks from mktap.

</pre>

@twisted-trac
Copy link
Author

rich's avatar rich commented
#!html
<pre>
new patch for server.py that handles twisted.web as well as woven

</pre>

@twisted-trac
Copy link
Author

itamarst's avatar @itamarst commented
#!html
<pre>
To remind me to look at this.

</pre>

@twisted-trac
Copy link
Author

itamarst's avatar @itamarst commented
#!html
<pre>
Donovan, could you go about applying patches / fixes to woven and nevow for
this? I applied the applicable patches to twisted.web.

(it's utils.py and view.py).

I changed the attribute name to displayTracebacks.
</pre>

@twisted-trac
Copy link
Author

jerub's avatar @jerub set status to closed

Fixed a long time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant