# נכשל ייבוא ערכת נושא דרך API מ-Gitlab עם טוקן ב-URL

**URL:** <https://meta.discourse.org/t/failing-to-import-theme-via-api-from-gitlab-with-token-in-url/251847>\
**Category:** Product Support\
**Created:** [15 בינואר,‏ 2023,‏ 7:19pm UTC](https://meta.discourse.org/t/failing-to-import-theme-via-api-from-gitlab-with-token-in-url/251847 "2023-01-15T19:19:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [15 בינואר,‏ 2023,‏ 7:19pm UTC](https://meta.discourse.org/t/failing-to-import-theme-via-api-from-gitlab-with-token-in-url/251847/1 "2023-01-15T19:19:31Z")

</div>

Hey all,

I’m struggling to upload a remote theme via API from GitLab (with token in URL) using `discourse_api, '0.38'`

This worked for v2.9.0beta10 but seems to be failing for 3.0.0.

The post request is returning this client side:

```plaintext
/opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:158:in `handle_error': DiscourseApi::Error
        from /opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:141:in `request'
        from /opt/bundle/gems/discourse_api-0.38.0/lib/discourse_api/client.rb:90:in `post'

```

I’m getting this in the target development Discourse instance logs:

`Failed to process hijacked response correctly : FinalDestination::SSRFDetector::DisallowedIpError : FinalDestination: all resolved IPs were disallowed`

Noting these commits: [SECURITY: Expand and improve SSRF Protections (#18815) · discourse/discourse@68b4fe4 · GitHub](https://github.com/discourse/discourse/commit/68b4fe4cf876ba4838dfc797655a038d34d2b27f) , [FIX: Theme import error handling needs to happen inside the hijack bl… · discourse/discourse@1398bd5 · GitHub](https://github.com/discourse/discourse/commit/1398bd5f1f5ee79999610f2b5a2640fc498c72ea) ,  
[FIX: When following redirects before cloning, use the first git reque… · discourse/discourse@d9364a2 · GitHub](https://github.com/discourse/discourse/commit/d9364a272e1b59b7d280d76898399ec14efec6f6)

(which is not long after the beta tag for which it was working)

Is there some additional config I need in order to permit the request?

I see there was a related Topic here, but it’s closed:

> [@Themes/components from GitLab gives error 500 when installing/updating](https://meta.discourse.org/t/themes-components-from-gitlab-gives-error-500-when-installing-updating/243971/5):
>
> Almost certainly because of the [SSRF protections](https://github.com/discourse/discourse/commit/68b4fe4cf876ba4838dfc797655a038d34d2b27f) fixes. Gitlab is 301 redirecting a git clone for [https://gitlab.com/silentboatman/discourse-masonry-image-gallery](https://gitlab.com/silentboatman/discourse-masonry-image-gallery) to [https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/](https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/) (sic, ends with .git/) but git is called with -c http.followRedirects=false so it fails. Entering [https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/](https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/) as the repository URL directly does not work because that is reverted back to [https://gitlab.c…](https://gitlab.com/silentboatman/discourse-masonry-image-gallery)

---

_[View the full topic](https://meta.discourse.org/t/failing-to-import-theme-via-api-from-gitlab-with-token-in-url/251847)._
