Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

#12095 closed enhancement (fixed)

Add is_xhr property to Request class

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: low Milestone: 1.1.6
Component: web frontend Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:

Added is_xhr property to the Request class. The property is True if the request header contains X-Requested-With: XMLHttpRequest.

Internal Changes:

Description

Adding an is_xhr method to Request would allow several instances of the following statement to be replaced:

req.get_header('X-Requested-With') == 'XMLHttpRequest

Attachments (0)

Change History (7)

comment:1 by Ryan J Ollos, 9 years ago

API Changes: modified (diff)
Status: newassigned
Type: defectenhancement

Proposed changes in log:rjollos.git:t12095-is-xhr.

Edit: I'm seeing functional test failures. I'll post revised changes shortly.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:2 by Ryan J Ollos, 9 years ago

Revised changes in log:rjollos.git:t12095-is-xhr.1.

in reply to:  2 ; comment:3 by Jun Omae, 9 years ago

Replying to rjollos:

Revised changes in log:rjollos.git:t12095-is-xhr.1.

Adding Request.is_xhr property is good idea and the proposed changes look good to me.

in reply to:  3 comment:4 by Christian Boos, 9 years ago

Replying to jomae:

Adding Request.is_xhr property is good idea and the proposed changes look good to me.

Seconded, it's something I wanted to do myself "back in the time" ;-)

comment:5 by Ryan J Ollos, 9 years ago

Thanks for the review. I added a few more changes in [3dcd619abd/rjollos.git], based on Request being available when rendering the template and _display_html being an internal method that we can modify the signature for without breaking API compatibility. Tests are passing for me, but I haven't done much manual testing yet. I'll test more before committing.

comment:6 by Ryan J Ollos, 9 years ago

Priority: normallow

comment:7 by Ryan J Ollos, 9 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [14099].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.