-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Fetch target images in auth envs #1420
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1420 +/- ##
==========================================
- Coverage 41.25% 41.20% -0.05%
==========================================
Files 138 139 +1
Lines 4349 4371 +22
Branches 1005 1007 +2
==========================================
+ Hits 1794 1801 +7
- Misses 2543 2558 +15
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch to see the 302 response is the request missing auth headers!
A few suggestions to tighten things up.
The biggest issue is getting the content correct in the data url. Try creating your own custom target with a png or jpg image upload..
@@ -68,6 +69,8 @@ export const TargetCard: React.FC<TargetCardProps> = ({ | |||
const { t } = useTranslation(); | |||
const [isCardSelected, setCardSelected] = React.useState(cardSelected); | |||
|
|||
const [imageDataUrl, setImageDataUrl] = React.useState<string | null>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really a url anymore, it's just the image data itself, so.... s/imageDataUrl/imageData/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so reading it again today (with less blurry eyes and more coffee) and it really is a data-url. So the name does make sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 Updated
Signed-off-by: ibolton336 <[email protected]>
Signed-off-by: ibolton336 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes https://issues.redhat.com/browse/MTA-1249?filter=-1 - Image was not being fetched in envs with auth enabled. Image tags (<img>) in HTML do not follow the same request mechanism as AJAX or fetch requests. They do not use the XMLHttpRequest or axios API, so they were not intercepted by axios middleware interceptor we have set up for API requests. --------- Signed-off-by: ibolton336 <[email protected]>
Closes https://issues.redhat.com/browse/MTA-1249?filter=-1