MemeLabs / MemeLabs/Rustla2

mobile navbar toggler's icon is blocked by CSP

Open
#226 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug frontend
Dominant language
C++
Stars
46
Forks
24
PR merge metrics
No merged PRs in 30d

Description

The navbar toggler that appears in mobile viewports has a "hamburger menu" icon that is unfortunately blocked by the site's CSP. The icon is defined inline:

```css
.navbar-dark .navbar-toggler-icon {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
```

Error from browser devtools:

> Content Security Policy: The page’s settings blocked the loading of a resource at data:image/svg+xml,%3csvg viewBox='0 0 3… (“img-src”).

The fix could be to either adjust the CSP (within reason) to allow this inline image, or replace the image with [the respective Font Awesome icon](https://fontawesome.com/v4.7.0/icon/bars) instead.

## Expected

![image](https://user-images.githubusercontent.com/733364/68722450-7c26e580-0583-11ea-9962-de98cb9c5e89.png)

## Actual

![image](https://user-images.githubusercontent.com/733364/68722326-19cde500-0583-11ea-81e3-f48b5f75387a.png)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the mobile navbar toggler, its inline SVG background rule, and the site's CSP configuration; reproduce the blocked data:image error in a mobile viewport. Finish when the hamburger icon renders under the site's CSP and the expected and actual states no longer differ.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.