You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/08/23 21:46:00 UTC

[jira] [Commented] (AIRFLOW-2910) HTTP Connection not obvious how use with https://

    [ https://issues.apache.org/jira/browse/AIRFLOW-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17403399#comment-17403399 ] 

ASF subversion and git services commented on AIRFLOW-2910:
----------------------------------------------------------

Commit a0ce41cc80a8c187800417b8484a305dd910dde0 in airflow's branch refs/heads/main from Jarek Potiuk
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=a0ce41c ]

Add warning about https configuration in SimpleHttpOperator (#17783)

For historical reasons, configuring ``https`` via SimpleHttpOperator
is well, complex.

This PR adds warning which informs the users about it as well
provides explanation why it is like that and gives some helpful
examples, so that people do not have to look for answers in
StackOverflow questions or GitHub issues or JIRAs (as they did
so far - for example #17780 and in
https://issues.apache.org/jira/browse/AIRFLOW-2910 or
https://stackoverflow.com/questions/51630344
and many other questions.

> HTTP Connection not obvious how use with https://
> -------------------------------------------------
>
>                 Key: AIRFLOW-2910
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2910
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: isaac martin
>            Priority: Major
>
> The SimpleHttpOperator, and anything else relying on airlfow.models.Connection, cannot make use of https due to what appears to be a bug in the way it parses user-provided urls. The bug ends up replacing any https uri with an http uri.
> To reproduce:
>  * Create a new airflow implementation.
>  * Set a connection environment var: AIRFLOW_CONN_ETL_API=[https://yourdomain.com|https://yourdomain.com/]
>  * Instantiate a SimpleHttpOperator which uses the above for its http_conn_id argument.
>  * Notice with horror that your requests are made to http://yourdomain.com
> To fix:
> Proposal 1
> Line 590 of airflow.models.py assigns nothing to Connection.schema. 
> Change:
> self.schema = temp_uri.path[1:]
> to
> self.schema = temp_uri[0]
>  
> Proposal 2:
> Line 40 or airflow.hooks.http_hook.py starts a block which tries to set the base_url. We could add a new elif which checks self.conn_type, as self.conn_type is correctly populated with 'https'.
> For example:
> elif conn.conn_type:
>     self.base_url = conn.conn_type + "://" + conn.host



--
This message was sent by Atlassian Jira
(v8.3.4#803005)