No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. trainerocom
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Groups 0

    trainerocom

    @trainerocom

    0
    Reputation
    85
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website trainero.com Location Finland

    trainerocom Follow

    Latest posts made by trainerocom

    • openUrl with custom headers

      I need to use openURL to fetch PDF that is behind the authorization. The target URL is not directly the PDF-file, but a PHP script that checks Bearer token from request’s Authorization headers, and then provides the file.

      Is there any way to provide custom headers in openURL call?

      I could do the same by axios, native window.open, etc, but this also must work with Cordova app and I believe the openUrl handles all the quirks that are involved.

      Suggestions?

      Currently I have a workaround with some hacks in backend to check token from query string if not present in headers.

      if (this.$q.platform.is.cordova) {
           openURL('/target-url/pdf/' + token);
       } else {
           this.$http.get('/target-url/pdf', { 
              responseType: 'arraybuffer',
              headers:  {
                  'Authorization': 'Bearer ' + token,
             }
          });
      }
      
      posted in Help
      T
      trainerocom