Skip to content

Conversation

dhx
Copy link
Contributor

@dhx dhx commented Feb 24, 2024

Seems the outline API has changed the collections export endpoint as of ( outline/openapi@ef782ca#diff-543af4ad11a870531a5ccc129b39a1b4d2c7860812f2015b697524c5d636f800R1084 ) - now we have to check the created FileOperation for completion before we can download the zip file.

Necessary change introduced in this PR:
As until now the client implementation replaced single underscores with a dot this was not compatible with underscores in the API URIs. Because of that only double underscores in the method name should be replaced with a dot instead.

As until now the client implementation replaced single underscores with a dot
this was not compatible with underscores in the API URIs.
For this reason now double underscores in the method name are replaced with a
dot instead.
@dhx dhx mentioned this pull request Feb 24, 2024
@Mag1cByt3s
Copy link

Why does this not get merged? I currently have no test instance to test this pr. But this would be extremely helpful if this gets back to working state.

@dhx
Copy link
Contributor Author

dhx commented Mar 5, 2024

@Mag1cByt3s feel free to use this docker image for testing this pr: ghcr.io/dhx/outliner:main

@captn3m0 any suggestions how to get this merged are welcome :)

@captn3m0
Copy link
Owner

captn3m0 commented Mar 5, 2024 via email

@captn3m0
Copy link
Owner

captn3m0 commented Mar 7, 2024

Testing this against the a getoutline.com hosted instance, and the Redirect Fileoperation request keeps erroring out at CloudFront:

<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: ujuU1zzHA2zM2RcCxaX6iW-oimXGvVMujdrOCcXlJ2zO4vY6jStuxQ==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>'

Seeing if I can add a workaround for this.

@captn3m0
Copy link
Owner

captn3m0 commented Mar 7, 2024

HTTParty is re-sending the request body over the 302 and that causes cloudfront to trip and return a 403.

Found an upstream issue: jnunemaker/httparty#783

Fixes redirect issues.

httparty sends request body at 302 redirects, so we
disable redirect follows for our fileoperations.redirect
call.

minor changes in client as well:

1. drops the token from the body, and sends it in header instead
   as per the new api
2. support additional options
@captn3m0 captn3m0 merged commit 787e838 into captn3m0:master Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants