summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-10-12 11:17:48 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-10-12 11:17:48 +0200
commitaacf10758c4456f0829ec071c131fe3de800c801 (patch)
tree6a3cc2b06600f49622ceb8c9872de4ead6dc4415
parentaf070ce8a7b5f7cb1f7873b0d1f815c7c31565f5 (diff)
parent1c11665c296c946508a52b846a15c29861a1d935 (diff)
downloadgitlab-ce-aacf10758c4456f0829ec071c131fe3de800c801.tar.gz
terminal support
-rw-r--r--app/controllers/projects/deployments_controller.rb6
-rw-r--r--lib/banzai/filter/html_entity_filter.rb2
-rw-r--r--lib/banzai/pipeline/single_line_pipeline.rb2
-rw-r--r--spec/lib/banzai/filter/html_entity_filter_spec.rb2
4 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/projects/deployments_controller.rb b/app/controllers/projects/deployments_controller.rb
index 5c88a9fd543..321f8324866 100644
--- a/app/controllers/projects/deployments_controller.rb
+++ b/app/controllers/projects/deployments_controller.rb
@@ -8,9 +8,11 @@ class Projects::DeploymentsController < Projects::ApplicationController
def terminal_websocket_authorize
Gitlab::Workhorse.verify_api_request!(request.headers)
- if true # extra access checks, config flags can go here
+ openshift_project = project.variables.find('CI_PROJECT_NAME').to_s
+ openshift_app = project.variables.find('APP').to_s
+ if openshift_project.present? && openshift_app.present?
set_workhorse_internal_api_content_type
- render json: {} # Kubernetes namespace/pod/container should go here
+ render json: {openshift_app: openshift_app, openshift_project: openshift_project}
else
render text: 'Not found', status: 404
end
diff --git a/lib/banzai/filter/html_entity_filter.rb b/lib/banzai/filter/html_entity_filter.rb
index 4ef8b3b6dcf..e008fd428b0 100644
--- a/lib/banzai/filter/html_entity_filter.rb
+++ b/lib/banzai/filter/html_entity_filter.rb
@@ -3,7 +3,7 @@ require 'erb'
module Banzai
module Filter
# Text filter that escapes these HTML entities: & " < >
- class HTMLEntityFilter < HTML::Pipeline::TextFilter
+ class HtmlEntityFilter < HTML::Pipeline::TextFilter
def call
ERB::Util.html_escape(text)
end
diff --git a/lib/banzai/pipeline/single_line_pipeline.rb b/lib/banzai/pipeline/single_line_pipeline.rb
index 30bc035d085..1929099931b 100644
--- a/lib/banzai/pipeline/single_line_pipeline.rb
+++ b/lib/banzai/pipeline/single_line_pipeline.rb
@@ -3,7 +3,7 @@ module Banzai
class SingleLinePipeline < GfmPipeline
def self.filters
@filters ||= FilterArray[
- Filter::HTMLEntityFilter,
+ Filter::HtmlEntityFilter,
Filter::SanitizationFilter,
Filter::EmojiFilter,
diff --git a/spec/lib/banzai/filter/html_entity_filter_spec.rb b/spec/lib/banzai/filter/html_entity_filter_spec.rb
index 6dc4a970071..4c68ce6d6e4 100644
--- a/spec/lib/banzai/filter/html_entity_filter_spec.rb
+++ b/spec/lib/banzai/filter/html_entity_filter_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Banzai::Filter::HTMLEntityFilter, lib: true do
+describe Banzai::Filter::HtmlEntityFilter, lib: true do
include FilterSpecHelper
let(:unescaped) { 'foo <strike attr="foo">&&&</strike>' }