Project

General

Profile

« Previous | Next » 

Revision 9529

Added by Chris Jones over 8 years ago

Modify the Metacat.pm sendData() method to include the Authorization HTTP header when it's available as an instance variable.

refs https://github.nceas.ucsb.edu/KNB/arctic-data/issues/41

View differences:

src/perl/Metacat/Metacat.pm
108 108
      $contentType = $postData{'enctype'};
109 109
      delete $postData{'enctype'};
110 110
  }
111
  
112
  
113
  my $request;
114
  if ( $self->{'auth_token_header'} ) {
115
      # if available, set the Authorization header from the auth_token_header instance variable
116
      $request = POST("$self->{'metacatUrl'}",
117
                      Content_Type => $contentType,
118
                      Authorization => $self->{'auth_token_header'},
119
                      Content => \%postData
120
                      );
121
      
122
  } else {
123
      $request = POST("$self->{'metacatUrl'}",
124
                      Content_Type => $contentType,
125
                      Content => \%postData
126
                      );      
127
  }
111 128

  
112
  my $request = POST("$self->{'metacatUrl'}",
113
                     Content_Type => $contentType,
114
                     Content => \%postData
115
                );
116

  
117 129
  # set cookies on UA object
118 130
  my $cookie_jar = $self->{'cookies'};
119 131
  $$cookie_jar->add_cookie_header($request);

Also available in: Unified diff