Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/roust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def authenticate!
)

cookie = response.headers['set-cookie']
self.class.headers['Cookie'] = cookie if cookie
self.class.default_cookies.add_cookies(cookie) if cookie
self.class.headers('Referer' => "#{@server}/REST/1.0")

# Switch the base uri over to the actual REST API base uri.
self.class.base_uri "#{@server}/REST/1.0"
Expand All @@ -60,7 +61,8 @@ def authenticate!
end

def authenticated?
return true if show('1')
show('1')
return true
rescue Unauthenticated
return false
end
Expand Down
1 change: 1 addition & 0 deletions lib/roust/ticket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def ticket_show(id)
body, _ = explode_response(response)

return nil if body =~ /^# (Ticket (\d+) does not exist\.)/
return nil if body =~ /^# You are not allowed to display ticket (\d+)./

parse_ticket_attributes(body)
end
Expand Down