ampproject / ampproject/amphtml

amp-img, when used with thumbor, gets an "Malformed URL" error

Open
#31,783 1 comment 0 reactions 0 assignees View on GitHub
Component: amp-img P3: When Possible Stale Type: Bug WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?

- amp-img, when used with [thumbor](https://github.com/thumbor/thumbor), gets an "Malformed URL" error
- original link works: https://img.vinshine.com/g3PaduaVx6xYAldjNou6Vq7YUMs=/filters:watermark(ngontinh-prod/icon/logo-text.png,-10,-10,10,30)/ngontinh-prod%2Fstory%2Fthumbnail%2Fac-nhan-thanh-doi.jpg
- after deploying and using amp cdn, the link becomes like this and no longer works because some characters have been altered: https://img-vinshine-com.cdn.ampproject.org/i/s/img.vinshine.com/g3PaduaVx6xYAldjNou6Vq7YUMs=/filters:watermark%28ngontinh-prod/icon/logo-text.png,-10,-10,10,30%29/ngontinh-prod/story/thumbnail/ac-nhan-thanh-doi.jpg
- thumbor logs
```
│ 2021-01-04 05:21:18 thumbor:WARNING Malformed URL: /g3PaduaVx6xYAldjNou6Vq7YUMs=/filters:watermark%28ngontinh-prod/icon/logo-text.png,-10,-10,10,30%29/ngontinh-prod/story/thumbnail/ac-nhan-thanh-doi.jpg │
│ 2021-01-04 05:21:18 tornado.access:WARNING 400 GET /g3PaduaVx6xYAldjNou6Vq7YUMs=/filters:watermark%28ngontinh-prod/icon/logo-text.png,-10,-10,10,30%29/ngontinh-prod/story/thumbnail/ac-nhan-thanh-doi.jpg (10.42.0.1) │
│ 2.41ms
```

## How do we reproduce the issue?

- use thumbor and amp-img together

## What browsers are affected?

All browsers

## Which AMP version is affected?

Version 2011252111003

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with amp-img and thumbor using the supplied original and AMP CDN URLs, then trace where the URL is transformed. Done means the thumbor URL remains valid through AMP CDN delivery and no longer produces the reported "Malformed URL" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.