Skip to content

URI-encode in the middleware? #8

Open
@Cerchie

Description

@Cerchie

I'm wondering why URI-encoding is left to the user?

I experimented a little this morning. In line 12 of headers.js, I inserted: request.headers.markdown = encodeURIComponent(request.headers.markdown);

Then, when I ran curl --location 'http://localhost:3000/blog/example' --header 'markdown: # Hello World' (I'll acknowledge it was difficult to get the original example markdown on one line, maybe that's part of it) I received a response including:

...
			
	<div class="blog">
		<h1 id="hello-world">Hello World</h1>

	</div>

so it seemed to be working from the curl response, but it was not reflected in the browser:
Screen Shot 2023-04-28 at 6 10 45 AM

Curious about why this might be, but also, why the user must URI-encode as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions