# Bug OP-3392 - "Protocol" setting is not exported to application context

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-3392

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 6.1.5 |
| Observed in versions |  |
| Sprint | 6.1.5 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

**Precondition**

  - OpenProject is set up behind an Apache2 SSL Reverse Proxy server.
  - All URLs are configured using HTTPS protocol.
  - HTTPS Protocol is set in System Settings

**How to reproduce**

1.  Go to an existing project
2.  Go in Members management page
3.  Edit a user. This will enable roles edition.
4.  Click on “Change” to validate a modification.
5.  Result: 404 Not Found

This scenario is also application to the “Delete” action in Project members’ page.

**Actual behavior**

Even if the protocol HTTP/HTTPS can be defined in the Settings, the value is not correctly exported. If modules’ or classes’ developers do not explicitly specify the “only\_path=true” option, the absolute link generate by the Ruby function “url\_for” will return a default “http” link, even if “HTTPS” is configured.

This behavior leads to break some features based on POST requests, as the server will reply with a “302 Found” to redirect to the “https” linked resources. But the following request will not keep the POST parameters, resulting in a routing fault and a “404 Not Found”.

**Expected behavior**

The editing and deleting features should work correctly with HTTPS protocol. Turning off SSL make it work with full HTTP protocol.

**Fix**

This option should offer a General scope fix that avoid this issue.

Edit the file:  
openproject/app/controllers/application\_controller.rb

Add protocol in the default URL options (line 124):  
def default\_url\_options(\_options = {})  
{  
layout: params\[‘layout’\],  
**protocol: Setting\[:protocol\]**  
}  
end
