Skip to content
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

Header location with POST return path and not url #1507

Closed
bourgeoa opened this issue Nov 6, 2020 · 4 comments
Closed

Header location with POST return path and not url #1507

bourgeoa opened this issue Nov 6, 2020 · 4 comments
Assignees

Comments

@bourgeoa
Copy link
Member

bourgeoa commented Nov 6, 2020

@csarven @michielbdejong @jeff-zucker
Doing tests with solid-rest we found that header location return path and I was expecting url.
What is the good content from spec viewpoint.

in https://github.com/solid/node-solid-server/blob/master/lib/handlers/post.js

  function one () {
    debug('Receving one file')
    const { slug, link, 'content-type': contentType } = req.headers
    const links = header.parseMetadataFromHeader(link)
    const mimeType = contentType ? contentType.replace(/\s*;.*/, '') : ''
    const extension = mimeType in extensions ? `.${extensions[mimeType][0]}` : ''

    ldp.post(req.hostname, containerPath, req,
      { slug, extension, container: links.isBasicContainer, contentType }).then(
      resourcePath => {
        debug('File stored in ' + resourcePath)
        header.addLinks(res, links)
        res.set('Location', resourcePath)
        res.sendStatus(201)
        next()
      },
      err => next(err))
  }
@bourgeoa bourgeoa reopened this Nov 21, 2021
@bourgeoa
Copy link
Member Author

@csarven What is the proper spec viewpoint ?
@jeff-zucker
I reopen this issue due to differences between NSS and CSS, see discussion in issue 0dataapp/hello#2

  • CSS header location return absolute URL in conformance with rfc2616-sec14.30,
  • but NSS header location return the relative url like in MDN fetch.

@bourgeoa bourgeoa self-assigned this Nov 22, 2021
@bourgeoa
Copy link
Member Author

@michielbdejong What do you think ? Does this imply a test-suite change ?

@csarven
Copy link
Member

csarven commented Nov 23, 2021

RFC 7231 obsoletes RFC 2616. RFC 7230/7231 uses Location = URI-reference referencing RFC 3986 and that can be an absolute or a relative reference.

@bourgeoa
Copy link
Member Author

bourgeoa commented Nov 23, 2021

@csarven thanks for the response.
https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.2

It is not so easy for app developer to imagine that location depends on server implementation.

We will have to update our solid-file-client library. jeff-zucker/solid-file-client#214

Anyway this closes the issue.

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

No branches or pull requests

2 participants