Apache AWF
  1. Apache AWF
  2. AWF-179

Add redirect method to HttpResponse

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Labels:
      None

      Description

      Convenience method
      from facebook/tornado

      def redirect(self, url, permanent=False):
      """Sends a redirect to the given (optionally relative) URL."""
      if self._headers_written:
      raise Exception("Cannot redirect after headers have been written")
      self.set_status(301 if permanent else 302)

      1. Remove whitespace
        url = re.sub(r"[\x00-\x20]+", "", _utf8(url))
        self.set_header("Location", urlparse.urljoin(self.request.uri, url))
        self.finish()

        Activity

        Anonymous created issue -
        Roger Schildmeijer made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Priority Trivial [ 5 ]
        Roger Schildmeijer made changes -
        Fix Version/s 0.4.0 [ 12317348 ]
        Tony Stevenson made changes -
        Project Deft [ 12311521 ] Apache AWF [ 12313220 ]
        Key DEFT-84 AWF-179
        Reporter Niklas Gustavsson [ niklas ]
        Fix Version/s 0.4.0 [ 12317348 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Niklas Gustavsson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development