Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1375

Add context attribute when request are processed by an AsynchronousValidator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 4.2.5, 4.3 Beta2
    • None
    • HttpCache
    • None

    Description

      With the current code, it seems to be no way to know if a request is being processed as a normal request, or if it is being processed by an AsynchronousValidator.

      Our use case is :

      • CachingHttpClient is used in a web app.
      • We use a custom cookie store to store cookies in user session (other usecases could be access to session/response objects while processing the request, custom code between CachingHttpClient and HttpClient).
      • We use background revalidation.
      • If the backend returns a cookie during revalidation, we have no longer access to the session so we want to ignore the cookie and prevent calls on session object.

      But we cannot identify the asynchronous request since it is the same as a synchronous one.

      A possible solution could be to add an attribute to the request context in AsynchronousValidationRequest constructor, something like : context.setAttribute( "asyncRequest", "true");

      Attachments

        Activity

          People

            Unassigned Unassigned
            nricheton Nicolas Richeton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: