GithubHelp home page GithubHelp logo

Comments (3)

voxpelli avatar voxpelli commented on June 10, 2024

Just adding PR here for reference: #12

I agree that a media endpoint should be supported in some way. Unfortunately I'm short of time at the moment.

If someone else could try out #12 and give feedback, then that would be 👍 👍 👍

from node-micropub-express.

paulrobertlloyd avatar paulrobertlloyd commented on June 10, 2024

Okay, I’ll take up the challenge! I’ve got a proof of concept going over on this branch (diff).

I’ve updated my dependency to point to @grantcodes updated node-micropub-express package. For the mediaHandler option, I’ve replicated the code used for the standard handler, the thinking being that this already includes support for uploading media.

I have managed to advertise a media-endpoint (based on a new config variable, which in my case I’m pointing straight back to this endpoint), however testing these changes using Micropub.rocks, I get the following results when trying to upload a photo:

✖️ Returned HTTP 201
✖️ Returned a Location header

HTTP/1.1 500 Internal Server Error
Server: Cowboy
Connection: keep-alive
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 148
Date: Sat, 03 Feb 2018 20:08:13 GMT
Via: 1.1 vegur

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Internal Server Error</pre>
</body>
</html>

I suspect that means duplicating handler was wishful thinking. Where am I going wrong, any clues?

from node-micropub-express.

paulrobertlloyd avatar paulrobertlloyd commented on June 10, 2024

Hmmm, I can find a references to Location header in the tests for the existing handler, but it’s not clear what code is sending that. Could you give point me in the direction where this header gets set (and might need to be set in the mediaHandler) please @voxpelli? Are headers governed by another dependancy?

from node-micropub-express.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.